summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-10-20 19:28:05 +0200
committerLudovic Courtès <ludo@gnu.org>2018-11-23 15:42:01 +0100
commit08f410834bffbe1e55633a0a4c87caba69d7fa92 (patch)
tree1013c1a9c3f92382c5cd6750d15d1cd36ba76326 /guix
parent4bd5b9707e14bd5ad4da6868687ff3c642705ce3 (diff)
pack: Add '--profile-name'.
* guix/scripts/pack.scm (self-contained-tarball): Add #:profile-name and honor it. (squashfs-image, docker-image): Add #:profile-name. (%default-options): Add 'profile-name'. (%options, show-help): Add "--profile-name". (guix-pack): Honor it. * tests/guix-pack-localstatedir.sh: New file. * Makefile.am (SH_TESTS): Add it. * doc/guix.texi (Invoking guix pack): Document "--profile-name".
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/pack.scm20
1 files changed, 19 insertions, 1 deletions
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index a86b95dd38..ce46f549cc 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -149,6 +149,7 @@ dependencies are registered."
(define* (self-contained-tarball name profile
#:key target
+ (profile-name "guix-profile")
deduplicate?
(compressor (first %compressors))
localstatedir?
@@ -221,6 +222,7 @@ added to the pack."
;; <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>.
(populate-single-profile-directory %root
#:profile #$profile
+ #:profile-name #$profile-name
#:closure "profile"
#:database #+database)
@@ -279,6 +281,7 @@ added to the pack."
(define* (squashfs-image name profile
#:key target
+ (profile-name "guix-profile")
(compressor (first %compressors))
localstatedir?
(symlinks '())
@@ -377,6 +380,7 @@ added to the pack."
(define* (docker-image name profile
#:key target
+ (profile-name "guix-profile")
(compressor (first %compressors))
localstatedir?
(symlinks '())
@@ -587,6 +591,7 @@ please email '~a'~%")
(define %default-options
;; Alist of default option values.
`((format . tarball)
+ (profile-name . "guix-profile")
(system . ,(%current-system))
(substitutes? . #t)
(build-hook? . #t)
@@ -658,6 +663,13 @@ please email '~a'~%")
(option '("localstatedir") #f #f
(lambda (opt name arg result)
(alist-cons 'localstatedir? #t result)))
+ (option '("profile-name") #t #f
+ (lambda (opt name arg result)
+ (match arg
+ ((or "guix-profile" "current-guix")
+ (alist-cons 'profile-name arg result))
+ (_
+ (leave (G_ "~a: unsupported profile name~%") arg)))))
(option '("bootstrap") #f #f
(lambda (opt name arg result)
(alist-cons 'bootstrap? #t result)))
@@ -691,6 +703,9 @@ Create a bundle of PACKAGE.\n"))
(display (G_ "
--localstatedir include /var/guix in the resulting pack"))
(display (G_ "
+ --profile-name=NAME
+ populate /var/guix/profiles/.../NAME"))
+ (display (G_ "
--bootstrap use the bootstrap binaries to build the pack"))
(newline)
(display (G_ "
@@ -779,7 +794,8 @@ Create a bundle of PACKAGE.\n"))
(#f
(leave (G_ "~a: unknown pack format~%")
pack-format))))
- (localstatedir? (assoc-ref opts 'localstatedir?)))
+ (localstatedir? (assoc-ref opts 'localstatedir?))
+ (profile-name (assoc-ref opts 'profile-name)))
(run-with-store store
(mlet* %store-monad ((profile (profile-derivation
manifest
@@ -798,6 +814,8 @@ Create a bundle of PACKAGE.\n"))
symlinks
#:localstatedir?
localstatedir?
+ #:profile-name
+ profile-name
#:archiver
archiver)))
(mbegin %store-monad