From patchwork Tue Mar 18 07:24:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 40316 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8E72827BBEA; Tue, 18 Mar 2025 07:27:59 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI, PDS_OTHER_BAD_TLD,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4F8E827BBE9 for ; Tue, 18 Mar 2025 07:27:59 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tuRMR-0007jT-H7; Tue, 18 Mar 2025 03:27:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tuRMK-0007ec-Q4 for guix-patches@gnu.org; Tue, 18 Mar 2025 03:27:36 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tuRM3-0001Ue-I5; Tue, 18 Mar 2025 03:27:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=7zUDax8dr2TIcICcWgGAsxmJXQ6OKJhMMpRzidbbTyg=; b=X2JW6TEFpE8E23tQ7yjhdJQkLvt14qy7GttmkbLGP9j85Y1YzoPj+ntQiaDBMAX1SJISHkdQmq+x92YApv98FpXyVYNZvBWGu8B25me8mhSHT48viGAm/AggYQS7vCTm+HBGZQS6RdRspQKNsih3+fkCNZJxG3eA1E2f/gYPbel/FxR3Z0EHriw2IhmF3YRNSoqJuHbmdqAxxWR9o6wZqauiJh7UTYtwuzQPgM71/06NO6IcKEJjBOr9xVoWqHbYhNe+u0VDK8Or1iekxT14e5beQa+X6PKxME4lQMhFrliiAJDY3tDGYqXaj2PIQsbTJJfIXrdyBYCRlttJg4iBWQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tuRM0-0004q4-RV; Tue, 18 Mar 2025 03:27:12 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77093] [PATCH rust-team 12/18] scripts: import: Pass "--insert" to importers. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: hako@ultrarare.space, guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 18 Mar 2025 07:27:12 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77093 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77093@debbugs.gnu.org Cc: Hilton Chain , Hilton Chain , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Hilton Chain , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77093-submit@debbugs.gnu.org id=B77093.174228281118315 (code B ref 77093); Tue, 18 Mar 2025 07:27:12 +0000 Received: (at 77093) by debbugs.gnu.org; 18 Mar 2025 07:26:51 +0000 Received: from localhost ([127.0.0.1]:35933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tuRLe-0004lF-RN for submit@debbugs.gnu.org; Tue, 18 Mar 2025 03:26:51 -0400 Received: from mx.boiledscript.com ([88.99.243.112]:51942) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tuRL4-0004fj-KB for 77093@debbugs.gnu.org; Tue, 18 Mar 2025 03:26:15 -0400 From: Hilton Chain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=mail; t=1742282773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CNgyHv90mI9Vh7ZD/xKVMWo0WFpglx6Sc5wNnUT5ayI=; b=U23p4hCHt0uVFByDj0ErM+NyiTE66vt+0R3esVq8MMPhesHF5mRcxqYQ6YCsn44bc7komk lMwPHOOf8ueML9/LcFVwEnm2IRU8k4yElZB8aboKXDl0vFUI/jkMU7aILp7gOK+DMSfoy8 4KyP6jiiJQFmHYEXoDgF6ih6saGqD+styXEx1gzGo+xrZbovOkozznuKQIRKeI3CehndMu +dl7AnSohvu//ZVnMSpMtPgwx1kkLnQMaRFYHWL85GDA9peIyWcIyXSt0BR/wn0S6iaegz dhESGopEkwOUGzzCKv1AjN6f51ID0I03z82pBfWWGV46a71r+E1a6tsGcvVwtg== Date: Tue, 18 Mar 2025 15:24:25 +0800 Message-ID: <64fd1ae561f6d188d599c54fe57710caabacf759.1742281797.git.hako@ultrarare.space> In-Reply-To: References: MIME-Version: 1.0 X-MS-Reactions: disallow X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches So that importers can adjust the file before inserting. * guix/scripts/import.scm (%standard-import-options): Add ‘--file-to-insert’. (guix-import): Pass it to importers when ‘--insert’ is set. Change-Id: I8e7a18ee8e0f96d7fc5688a207a7a5390ad2fa30 --- guix/scripts/import.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index aaa3d26673..1b2c35f3b1 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -31,6 +31,7 @@ (define-module (guix scripts import) #:use-module (guix utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-37) #:use-module (ice-9 format) #:use-module (ice-9 match) #:export (%standard-import-options @@ -41,7 +42,12 @@ (define-module (guix scripts import) ;;; Command line options. ;;; -(define %standard-import-options '()) +(define %standard-import-options + (list + ;; Hidden option for importer-specific file preprocessing. + (option '("file-to-insert") #f #t + (lambda (opt name arg result) + (alist-cons 'file-to-insert arg result))))) ;;; @@ -141,7 +147,10 @@ (define-command (guix-import . args) (newline port) (newline port) (close-port port))))))))) - (import-as-definitions importer args find-and-insert))) + (import-as-definitions importer + (cons (string-append "--file-to-insert=" file) + args) + find-and-insert))) ((importer args ...) (let ((print (lambda (expr) (leave-on-EPIPE