diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2016-05-20 22:14:46 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2016-05-21 01:35:14 +0200 |
| commit | ece6864bd04fc2f9ff86fd4ac9cb0712dd71c094 (patch) | |
| tree | 53334de02ef208350cdb7d9d05306e729ed2633f /tests/grafts.scm | |
| parent | cf8b312d1872aec1f38a179eeb981d79bf7faa03 (diff) | |
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.
Diffstat (limited to 'tests/grafts.scm')
| -rw-r--r-- | tests/grafts.scm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/grafts.scm b/tests/grafts.scm index f8c9eced1df..8cd048552c7 100644 --- a/tests/grafts.scm +++ b/tests/grafts.scm | |||
| @@ -182,4 +182,21 @@ | |||
| 182 | (and (string=? (readlink one) repl) | 182 | (and (string=? (readlink one) repl) |
| 183 | (string=? (readlink two) one)))))) | 183 | (string=? (readlink two) one)))))) |
| 184 | 184 | ||
| 185 | (test-assert "graft-derivation, renaming" ;<http://bugs.gnu.org/23132> | ||
| 186 | (let* ((build `(begin | ||
| 187 | (use-modules (guix build utils)) | ||
| 188 | (mkdir-p (string-append (assoc-ref %outputs "out") "/" | ||
| 189 | (assoc-ref %build-inputs "in"))))) | ||
| 190 | (orig (build-expression->derivation %store "thing-to-graft" build | ||
| 191 | #:modules '((guix build utils)) | ||
| 192 | #:inputs `(("in" ,%bash)))) | ||
| 193 | (repl (add-text-to-store %store "bash" "fake bash")) | ||
| 194 | (grafted (graft-derivation %store orig | ||
| 195 | (list (graft | ||
| 196 | (origin %bash) | ||
| 197 | (replacement repl)))))) | ||
| 198 | (and (build-derivations %store (list grafted)) | ||
| 199 | (let ((out (derivation->output-path grafted))) | ||
| 200 | (file-is-directory? (string-append out "/" repl)))))) | ||
| 201 | |||
| 185 | (test-end) | 202 | (test-end) |
