1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

grafts: Preserve empty directories when grafting.

* guix/build/graft.scm (rewrite-directory)[rewrite-leaf]: Add case for
'directory.
Pass #:directories? #t to 'find-files'.
This commit is contained in:
Ludovic Courtès
2016-05-20 22:11:56 +02:00
parent 30d4bc0434
commit cf8b312d18
2 changed files with 28 additions and 1 deletions

View File

@@ -127,6 +127,30 @@
(list one two dep)
(references %store dep)))))))
(test-assert "graft-derivation, preserve empty directories"
(run-with-store %store
(mlet* %store-monad ((fake (text-file "bash" "Fake bash."))
(graft -> (graft
(origin %bash)
(replacement fake)))
(drv (gexp->derivation
"to-graft"
#~(begin
(use-modules (guix build utils))
(mkdir-p (string-append #$output
"/a/b/c/d"))
(symlink #$%bash
(string-append #$output
"/bash")))
#:modules '((guix build utils))))
(grafted ((store-lift graft-derivation) drv
(list graft)))
(_ (built-derivations (list grafted)))
(out -> (derivation->output-path grafted)))
(return (and (string=? (readlink (string-append out "/bash"))
fake)
(file-is-directory? (string-append out "/a/b/c/d")))))))
(test-assert "graft-derivation, no dependencies on grafted output"
(run-with-store %store
(mlet* %store-monad ((fake (text-file "bash" "Fake bash."))