From 6b63c43e0661406bf9e8c4c54f517744fc2ffdb3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 14 Mar 2017 15:11:03 +0100 Subject: pack: Add '--localstatedir' option. * guix/scripts/pack.scm (self-contained-tarball): Add #:localstatedir? parameter and honor it. (%options, show-help): Add '--localstatedir'. (guix-pack): Honor it. * gnu/build/install.scm (populate-single-profile-directory): Add #:register? parameter and honor it. * doc/guix.texi (Binary Installation): Use '--localstatedir' in example. (Invoking guix pack): Document it. --- gnu/build/install.scm | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'gnu/build') diff --git a/gnu/build/install.scm b/gnu/build/install.scm index 5c2b35632d..11f107d63c 100644 --- a/gnu/build/install.scm +++ b/gnu/build/install.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; Copyright © 2016 Chris Marusich ;;; ;;; This file is part of GNU Guix. @@ -192,13 +192,16 @@ rest of STORE." (define* (populate-single-profile-directory directory #:key profile closure - deduplicate?) + deduplicate? + register?) "Populate DIRECTORY with a store containing PROFILE, whose closure is given in the file called CLOSURE (as generated by #:references-graphs.) DIRECTORY is initialized to contain a single profile under /root pointing to PROFILE. -DEDUPLICATE? determines whether to deduplicate files in the store. +When REGISTER? is true, initialize DIRECTORY/var/guix/db to reflect the +contents of the store; DEDUPLICATE? determines whether to deduplicate files in +the store. -This is used to create the self-contained Guix tarball." +This is used to create the self-contained tarballs with 'guix pack'." (define (scope file) (string-append directory "/" file)) @@ -213,14 +216,16 @@ This is used to create the self-contained Guix tarball." ;; Populate the store. (populate-store (list closure) directory) - (register-closure (canonicalize-path directory) closure - #:deduplicate? deduplicate?) - - ;; XXX: 'guix-register' registers profiles as GC roots but the symlink - ;; target uses $TMPDIR. Fix that. - (delete-file (scope "/var/guix/gcroots/profiles")) - (symlink* "/var/guix/profiles" - "/var/guix/gcroots/profiles") + + (when register? + (register-closure (canonicalize-path directory) closure + #:deduplicate? deduplicate?) + + ;; XXX: 'guix-register' registers profiles as GC roots but the symlink + ;; target uses $TMPDIR. Fix that. + (delete-file (scope "/var/guix/gcroots/profiles")) + (symlink* "/var/guix/profiles" + "/var/guix/gcroots/profiles")) ;; Make root's profile, which makes it a GC root. (mkdir-p* %root-profile) -- cgit v1.2.3