[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/08: pack: Allow multiple '--manifest' options.
From: |
guix-commits |
Subject: |
07/08: pack: Allow multiple '--manifest' options. |
Date: |
Fri, 22 Nov 2019 09:13:57 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit ca541f9ce692ef96f6d5638eb37f70714cedd933
Author: Ludovic Courtès <address@hidden>
Date: Wed Nov 20 12:13:32 2019 +0100
pack: Allow multiple '--manifest' options.
* guix/scripts/pack.scm (guix-pack): Collect 'manifest' options, and
concatenate the resulting manifests.
* tests/guix-pack.sh: Test it.
* doc/guix.texi (Invoking guix pack): Document it.
---
doc/guix.texi | 3 ++-
guix/scripts/pack.scm | 17 ++++++++++++-----
tests/guix-pack.sh | 11 +++++++++++
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 7ef7701..7a004d2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5178,7 +5178,8 @@ build} (@pxref{Additional Build Options,
@code{--expression} in
@item --manifest=@var{file}
@itemx -m @var{file}
Use the packages contained in the manifest object returned by the Scheme
-code in @var{file}.
+code in @var{file}. This option can be repeated several times, in which
+case the manifests are concatenated.
This has a similar purpose as the same-named option in @command{guix
package} (@pxref{profile-manifest, @option{--manifest}}) and uses the
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 89b3e38..c8a5237 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -965,7 +965,10 @@ Create a bundle of PACKAGE.\n"))
(list (transform store package) "out")))
(reverse
(filter-map maybe-package-argument opts))))
- (manifest-file (assoc-ref opts 'manifest)))
+ (manifests (filter-map (match-lambda
+ (('manifest . file) file)
+ (_ #f))
+ opts)))
(define properties
(if (assoc-ref opts 'save-provenance?)
(lambda (package)
@@ -979,11 +982,15 @@ Create a bundle of PACKAGE.\n"))
(const '())))
(cond
- ((and manifest-file (not (null? packages)))
+ ((and (not (null? manifests)) (not (null? packages)))
(leave (G_ "both a manifest and a package list were given~%")))
- (manifest-file
- (let ((user-module (make-user-module '((guix profiles) (gnu)))))
- (load* manifest-file user-module)))
+ ((not (null? manifests))
+ (concatenate-manifests
+ (map (lambda (file)
+ (let ((user-module (make-user-module
+ '((guix profiles) (gnu)))))
+ (load* file user-module)))
+ manifests)))
(else
(manifest
(map (match-lambda
diff --git a/tests/guix-pack.sh b/tests/guix-pack.sh
index cf4e4ca..7a0f340 100644
--- a/tests/guix-pack.sh
+++ b/tests/guix-pack.sh
@@ -109,3 +109,14 @@ drv1="`guix pack -n guile 2>&1 | grep pack.*\.drv`"
drv2="`guix pack -n --with-source=guile=$test_directory guile 2>&1 | grep
pack.*\.drv`"
test -n "$drv1"
test "$drv1" != "$drv2"
+
+# Try '--manifest' options.
+cat > "$test_directory/manifest1.scm" <<EOF
+(specifications->manifest '("guile"))
+EOF
+cat > "$test_directory/manifest2.scm" <<EOF
+(specifications->manifest '("emacs"))
+EOF
+drv="`guix pack -nd -m "$test_directory/manifest1.scm" -m
"$test_directory/manifest2.scm"`"
+guix gc -R "$drv" | grep `guix build guile -nd`
+guix gc -R "$drv" | grep `guix build emacs -nd`
- branch master updated (4e2e84d -> cf87919), guix-commits, 2019/11/22
- 03/08: import: texlive: Handle multi-license packages., guix-commits, 2019/11/22
- 01/08: substitute: Don't fetch /nix-cache-info., guix-commits, 2019/11/22
- 02/08: daemon: GC displays how much it has collected., guix-commits, 2019/11/22
- 07/08: pack: Allow multiple '--manifest' options.,
guix-commits <=
- 05/08: profiles: Add 'concatenate-manifests'., guix-commits, 2019/11/22
- 08/08: gnu: libseccomp: Fix build on AArch64., guix-commits, 2019/11/22
- 04/08: environment: Document that '--manifest' can be repeated., guix-commits, 2019/11/22
- 06/08: package: Allow multiple '--manifest' options., guix-commits, 2019/11/22