aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-06-04 22:06:34 +0200
committerLudovic Courtès <ludo@gnu.org>2018-06-14 11:16:58 +0200
commit6892f0a247a06ac12c8c462692f8b3f93e872911 (patch)
treee1ecedc4e1c4cb11613550275c2846eb31a024c6 /gnu
parentf8f9f7cabca3f0ea1f8b8cb4fecfc45889bdfb94 (diff)
downloadguix-6892f0a247a06ac12c8c462692f8b3f93e872911.tar
guix-6892f0a247a06ac12c8c462692f8b3f93e872911.tar.gz
store-copy: 'read-reference-graph' returns a list of records.
The previous implementation of 'read-reference-graph' was good enough for many use cases, but it discarded the graph structure, which is useful information in some cases. * guix/build/store-copy.scm (<store-info>): New record type. (read-reference-graph): Rewrite to return a list of <store-info>. (closure-size, populate-store): Adjust accordingly. * gnu/services/base.scm (references-file): Adjust accordingly. * gnu/system/vm.scm (system-docker-image): Likewise. * guix/scripts/pack.scm (squashfs-image, docker-image): Likewise. * tests/gexp.scm ("gexp->derivation #:references-graphs"): Likewise.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services/base.scm5
-rw-r--r--gnu/system/vm.scm6
2 files changed, 7 insertions, 4 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index b34bb7132b..68411439db 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1592,8 +1592,9 @@ failed to register hydra.gnu.org public key: ~a~%" status))))))))
(call-with-output-file #$output
(lambda (port)
- (write (call-with-input-file "graph"
- read-reference-graph)
+ (write (map store-info-item
+ (call-with-input-file "graph"
+ read-reference-graph))
port)))))
#:options `(#:local-build? #f
#:references-graphs (("graph" ,item))))
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 544c0e294d..4aea53d1cd 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -466,8 +466,10 @@ should set REGISTER-CLOSURES? to #f."
(build-docker-image
(string-append "/xchg/" #$name) ;; The output file.
(cons* root-directory
- (call-with-input-file (string-append "/xchg/" #$graph)
- read-reference-graph))
+ (map store-info-item
+ (call-with-input-file
+ (string-append "/xchg/" #$graph)
+ read-reference-graph)))
#$os-drv
#:compressor '(#+(file-append gzip "/bin/gzip") "-9n")
#:creation-time (make-time time-utc 0 1)