mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
store: 'export-paths' doesn't export references of the given files.
This fixes a regression introduced in
99fbddf9a6
("store: Change 'export-paths'
to always export in topological order.")
* guix/store.scm (export-paths): Define 'ordered' variable. Iterate
over it.
* tests/store.scm ("export/import paths, ensure topological order"): Add
'file0'. Adjust accordingly.
This commit is contained in:
parent
4d01bd3c1c
commit
cafb92d853
2 changed files with 11 additions and 3 deletions
|
@ -734,8 +734,13 @@ (define* (export-path server path port #:key (sign? #t))
|
|||
(define* (export-paths server paths port #:key (sign? #t))
|
||||
"Export the store paths listed in PATHS to PORT, in topological order,
|
||||
signing them if SIGN? is true."
|
||||
(define ordered
|
||||
;; Sort PATHS, but don't include their references.
|
||||
(filter (cut member <> paths)
|
||||
(topologically-sorted server paths)))
|
||||
|
||||
(let ((s (nix-server-socket server)))
|
||||
(let loop ((paths (topologically-sorted server paths)))
|
||||
(let loop ((paths ordered))
|
||||
(match paths
|
||||
(()
|
||||
(write-int 0 port))
|
||||
|
|
|
@ -399,7 +399,9 @@ (define (same? x y)
|
|||
files)))))))
|
||||
|
||||
(test-assert "export/import paths, ensure topological order"
|
||||
(let* ((file1 (add-text-to-store %store "foo" (random-text)))
|
||||
(let* ((file0 (add-text-to-store %store "baz" (random-text)))
|
||||
(file1 (add-text-to-store %store "foo" (random-text)
|
||||
(list file0)))
|
||||
(file2 (add-text-to-store %store "bar" (random-text)
|
||||
(list file1)))
|
||||
(files (list file1 file2))
|
||||
|
@ -412,9 +414,10 @@ (define (same? x y)
|
|||
(bytevector=? dump1 dump2)
|
||||
(let* ((source (open-bytevector-input-port dump1))
|
||||
(imported (import-paths %store source)))
|
||||
;; DUMP1 should contain exactly FILE1 and FILE2, not FILE0.
|
||||
(and (equal? imported (list file1 file2))
|
||||
(every file-exists? files)
|
||||
(null? (references %store file1))
|
||||
(equal? (list file0) (references %store file1))
|
||||
(equal? (list file1) (references %store file2)))))))
|
||||
|
||||
(test-assert "import corrupt path"
|
||||
|
|
Loading…
Reference in a new issue