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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user