GNU bug report logs - #77093
[PATCH rust-team 00/18] New Rust packaging workflow based on lockfile importer.

Previous Next

Package: guix-patches;

Reported by: Hilton Chain <hako <at> ultrarare.space>

Date: Tue, 18 Mar 2025 07:18:02 UTC

Severity: normal

Tags: patch

Full log


Message #41 received at 77093 <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: 77093 <at> debbugs.gnu.org
Cc: Hilton Chain <hako <at> ultrarare.space>
Subject: [PATCH rust-team 12/18] scripts: import: Pass "--insert" to importers.
Date: Tue, 18 Mar 2025 15:24:25 +0800
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
-- 
2.48.1





This bug report was last modified 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.