diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-01-17 15:59:00 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-01-17 15:59:00 +0100 |
commit | 5b3d863f0099257890f9714f81e24789f8e8e362 (patch) | |
tree | 0e99805e5b4c9bd6f61cd76c5a838230e1360678 /guix/store.scm | |
parent | 867d8473059ffdb0735587617b49547252af0d3d (diff) | |
download | gnu-guix-5b3d863f0099257890f9714f81e24789f8e8e362.tar gnu-guix-5b3d863f0099257890f9714f81e24789f8e8e362.tar.gz |
store: Add #:recursive? parameter to 'export-paths'.
* guix/store.scm (export-paths): Add #:recursive? parameter and honor
it.
* tests/store.scm ("export/import incomplete", "export/import
recursive"): New tests.
Diffstat (limited to 'guix/store.scm')
-rw-r--r-- | guix/store.scm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/guix/store.scm b/guix/store.scm index 82ed94bbc1..9e3074414e 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -795,13 +795,16 @@ is raised if the set of paths read from PORT is not signed (as per (or done? (loop (process-stderr server port)))) (= 1 (read-int s)))) -(define* (export-paths server paths port #:key (sign? #t)) +(define* (export-paths server paths port #:key (sign? #t) recursive?) "Export the store paths listed in PATHS to PORT, in topological order, -signing them if SIGN? is true." +signing them if SIGN? is true. When RECURSIVE? is true, export the closure of +PATHS---i.e., PATHS and all their dependencies." (define ordered - ;; Sort PATHS, but don't include their references. - (filter (cut member <> paths) - (topologically-sorted server paths))) + (let ((sorted (topologically-sorted server paths))) + ;; When RECURSIVE? is #f, filter out the references of PATHS. + (if recursive? + sorted + (filter (cut member <> paths) sorted)))) (let ((s (nix-server-socket server))) (let loop ((paths ordered)) |