pack: Fix handling of '-e'.

Fixes a regression introduced in
aad16cc196.
Reported by Julien Lepiller.

* guix/scripts/pack.scm (guix-pack)[manifest-from-args]: In
'match-lambda', add clause for single packages.
* tests/guix-pack.sh: Add test for '-e'.
This commit is contained in:
Ludovic Courtès 2018-05-07 14:04:19 +02:00
parent 91a56b4ab5
commit d26727a143
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 8 additions and 4 deletions

View file

@ -402,8 +402,9 @@ (define (manifest-from-args store opts)
(let* ((transform (options->transformation opts)) (let* ((transform (options->transformation opts))
(packages (map (match-lambda (packages (map (match-lambda
(((? package? package) output) (((? package? package) output)
(list (transform store package) (list (transform store package) output))
output))) ((? package? package)
(list (transform store package) "out")))
(filter-map maybe-package-argument opts))) (filter-map maybe-package-argument opts)))
(manifest-file (assoc-ref opts 'manifest))) (manifest-file (assoc-ref opts 'manifest)))
(cond (cond

View file

@ -35,8 +35,11 @@ export GUIX_BUILD_OPTIONS
# Build a tarball with no compression. # Build a tarball with no compression.
guix pack --compression=none --bootstrap guile-bootstrap guix pack --compression=none --bootstrap guile-bootstrap
# Build a tarball (with compression). # Build a tarball (with compression). Check that '-e' works as well.
guix pack --bootstrap guile-bootstrap out1="`guix pack --bootstrap guile-bootstrap`"
out2="`guix pack --bootstrap -e '(@ (gnu packages bootstrap) %bootstrap-guile)'`"
test -n "$out1"
test "$out1" = "$out2"
# Build a tarball with a symlink. # Build a tarball with a symlink.
the_pack="`guix pack --bootstrap -S /opt/gnu/bin=bin guile-bootstrap`" the_pack="`guix pack --bootstrap -S /opt/gnu/bin=bin guile-bootstrap`"