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

grafts: Rename files whose name matches a graft.

Fixes <http://bugs.gnu.org/23132>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/build/graft.scm (rename-matching-files): New procedure.
(rewrite-directory): Use it.
* tests/grafts.scm ("graft-derivation, renaming"): New test.
This commit is contained in:
Ludovic Courtès
2016-05-20 22:14:46 +02:00
parent cf8b312d18
commit ece6864bd0
2 changed files with 41 additions and 1 deletions

View File

@@ -182,4 +182,21 @@
(and (string=? (readlink one) repl)
(string=? (readlink two) one))))))
(test-assert "graft-derivation, renaming" ;<http://bugs.gnu.org/23132>
(let* ((build `(begin
(use-modules (guix build utils))
(mkdir-p (string-append (assoc-ref %outputs "out") "/"
(assoc-ref %build-inputs "in")))))
(orig (build-expression->derivation %store "thing-to-graft" build
#:modules '((guix build utils))
#:inputs `(("in" ,%bash))))
(repl (add-text-to-store %store "bash" "fake bash"))
(grafted (graft-derivation %store orig
(list (graft
(origin %bash)
(replacement repl))))))
(and (build-derivations %store (list grafted))
(let ((out (derivation->output-path grafted)))
(file-is-directory? (string-append out "/" repl))))))
(test-end)