GNU bug report logs - #54910
[PATCH] guix: import: Convert inputs to the new format.

Previous Next

Package: guix-patches;

Reported by: Attila Lendvai <attila <at> lendvai.name>

Date: Wed, 13 Apr 2022 12:32:01 UTC

Severity: normal

Tags: patch

Full log


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

From: Attila Lendvai <attila <at> lendvai.name>
To: guix-patches <at> gnu.org
Cc: Attila Lendvai <attila <at> lendvai.name>
Subject: [PATCH] guix: import: Convert inputs to the new format.
Date: Wed, 13 Apr 2022 14:30:59 +0200
* guix/import/utils.scm (package-names->package-inputs): Return the simplified format.
(maybe-inputs): Use the simplified format.
---
 guix/import/utils.scm | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 9cadbb3d5f..40dae55acd 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -268,12 +268,13 @@ (define* (package-names->package-inputs names #:optional (output #f))
 optional OUTPUT, tries to generate a quoted list of inputs, as suitable to
 use in an 'inputs' field of a package definition."
   (define (make-input input version)
-    (cons* input (list 'unquote (string->symbol
-                                 (if version
-                                     (string-append input "-" version)
-                                     input)))
-           (or (and output (list output))
-               '())))
+    (let ((pkg (string->symbol
+                (if version
+                    (string-append input "-" version)
+                    input))))
+      (if output
+          (list pkg output)
+          pkg)))
 
   (map (match-lambda
          ((input version) (make-input input version))
@@ -294,7 +295,7 @@ (define* (maybe-inputs package-names #:optional (output #f)
       (()
        '())
       ((package-inputs ...)
-       `((,field-name (,'quasiquote ,package-inputs)))))))
+       `((,field-name (list ,@package-inputs)))))))
 
 (define* (maybe-native-inputs package-names #:optional (output #f))
   "Same as MAYBE-INPUTS, but for native inputs."
-- 
2.35.1





This bug report was last modified 3 years and 22 days ago.

Previous Next


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