summary refs log tree commit diff
path: root/gnu/build/install.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2015-06-18 01:32:37 -0400
committerMark H Weaver <mhw@netris.org>2015-06-18 01:32:37 -0400
commit2abf678682c42842c16e026c51d96b1fa86be88f (patch)
tree7bd59bd08dbaf00f23f37a91d1e7ae3d7a915843 /gnu/build/install.scm
parent9ae1e920718e95577c12de890754b6a6a4ff70a1 (diff)
parentc362a40a5825faafc76b72f69fb6595fa29d3f60 (diff)
downloadguix-2abf678682c42842c16e026c51d96b1fa86be88f.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/build/install.scm')
-rw-r--r--gnu/build/install.scm20
1 files changed, 14 insertions, 6 deletions
diff --git a/gnu/build/install.scm b/gnu/build/install.scm
index 32fbe8efbc..9085e22e09 100644
--- a/gnu/build/install.scm
+++ b/gnu/build/install.scm
@@ -161,20 +161,27 @@ as created and modified at the Epoch."
                   (utime file 0 0 0 0))))
             (find-files directory "")))
 
-(define (register-closure store closure)
+(define* (register-closure store closure
+                           #:key (deduplicate? #t))
   "Register CLOSURE in STORE, where STORE is the directory name of the target
 store and CLOSURE is the name of a file containing a reference graph as used
-by 'guix-register'.  As a side effect, this resets timestamps on store files."
-  (let ((status (system* "guix-register" "--prefix" store
-                         closure)))
+by 'guix-register'.  As a side effect, this resets timestamps on store files
+and, if DEDUPLICATE? is true, deduplicates files common to CLOSURE and the
+rest of STORE."
+  (let ((status (apply system* "guix-register" "--prefix" store
+                       (append (if deduplicate? '() '("--no-deduplication"))
+                               (list closure)))))
     (unless (zero? status)
       (error "failed to register store items" closure))))
 
 (define* (populate-single-profile-directory directory
-                                            #:key profile closure)
+                                            #:key profile closure
+                                            deduplicate?)
   "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.
+
 This is used to create the self-contained Guix tarball."
   (define (scope file)
     (string-append directory "/" file))
@@ -190,7 +197,8 @@ This is used to create the self-contained Guix tarball."
 
   ;; Populate the store.
   (populate-store (list closure) directory)
-  (register-closure (canonicalize-path directory) closure)
+  (register-closure (canonicalize-path directory) closure
+                    #:deduplicate? deduplicate?)
 
   ;; XXX: 'guix-register' registers profiles as GC roots but the symlink
   ;; target uses $TMPDIR.  Fix that.