diff mbox series

[bug#49531,core-updates,1/4] import: utils: Emit new-style package inputs.

Message ID e04ca693d1e9c9899701ba8868db639949e3cd78.1626067919.git.iskarian@mgsn.dev
State New
Headers show
Series import: {utils, go, crate}: Emit new-style package inputs. | expand

Commit Message

Sarah Morgensen July 12, 2021, 5:48 a.m. UTC
* guix/import/utils.scm (package-names->package-inputs)[make-input]:
Return new-style package inputs.
(maybe-inputs): Wrap PACKAGE-INPUTS in 'list' instead of 'quasiquote'.
---
 guix/import/utils.scm | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Ludovic Courtès July 20, 2021, 9:22 p.m. UTC | #1
Hi,

Sarah Morgensen <iskarian@mgsn.dev> skribis:

> * guix/import/utils.scm (package-names->package-inputs)[make-input]:
> Return new-style package inputs.
> (maybe-inputs): Wrap PACKAGE-INPUTS in 'list' instead of 'quasiquote'.

Applied this patch squeezed with patch #2, which adjusts tests/go.scm,
because tests should be modified in the same commit (ideally, one should
be able to take any commit and be sure that tests pass).

Thanks!

Ludo’.
Ludovic Courtès July 20, 2021, 9:36 p.m. UTC | #2
Ludovic Courtès <ludo@gnu.org> skribis:

> Sarah Morgensen <iskarian@mgsn.dev> skribis:
>
>> * guix/import/utils.scm (package-names->package-inputs)[make-input]:
>> Return new-style package inputs.
>> (maybe-inputs): Wrap PACKAGE-INPUTS in 'list' instead of 'quasiquote'.
>
> Applied this patch squeezed with patch #2, which adjusts tests/go.scm,
> because tests should be modified in the same commit (ideally, one should
> be able to take any commit and be sure that tests pass).

Actually no, I didn’t apply it in the end, because that’s tied to the
Crate/Cargo changes as well.  :-/

Ludo’.
Sarah Morgensen July 21, 2021, 3:03 a.m. UTC | #3
Hi,

Ludovic Courtès <ludo@gnu.org> writes:

> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> Sarah Morgensen <iskarian@mgsn.dev> skribis:
>>
>>> * guix/import/utils.scm (package-names->package-inputs)[make-input]:
>>> Return new-style package inputs.
>>> (maybe-inputs): Wrap PACKAGE-INPUTS in 'list' instead of 'quasiquote'.
>>
>> Applied this patch squeezed with patch #2, which adjusts tests/go.scm,
>> because tests should be modified in the same commit (ideally, one should
>> be able to take any commit and be sure that tests pass).
>
> Actually no, I didn’t apply it in the end, because that’s tied to the
> Crate/Cargo changes as well.  :-/
>
> Ludo’.

Apologies for the trouble! I've sent a rebased v2 (in-reply-to the
original patch; forgot to CC you) that just takes care of the go
importer and lets crate continue to live in its own world until we
decide its fate.

--
Sarah
diff mbox series

Patch

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index d817318a91..8fa017e18f 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -8,6 +8,7 @@ 
 ;;; Copyright © 2020 Helio Machado <0x2b3bfa0+guix@googlemail.com>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -237,12 +238,10 @@  into a proper sentence and by using two spaces between sentences."
 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 ((name (if version (string-append input "-" version) input)))
+      (if output
+          (list (string->symbol name) output)
+          (string->symbol name))))
 
   (map (match-lambda
          ((input version) (make-input input version))
@@ -263,7 +262,7 @@  snippet generated is for regular inputs."
       (()
        '())
       ((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."