Fix `imported-files' for files with a common prefix.

* guix/derivations.scm (imported-files)[builder]: For TAIL, check
  whether it exists before (mkdir TAIL).

* tests/derivations.scm ("imported-files"): Add file with a common
  prefix.
This commit is contained in:
Ludovic Courtès 2012-06-12 23:30:00 +02:00
parent d1b1c4249a
commit 224f7ad6a3
2 changed files with 4 additions and 2 deletions

View file

@ -412,7 +412,8 @@ (define (parent-dirs file-name)
`(false-if-exception `(false-if-exception
(mkdir ,d))) (mkdir ,d)))
head) head)
`((mkdir ,tail))))) `((or (file-exists? ,tail)
(mkdir ,tail))))))
`((symlink ,store-path ,final-path))))) `((symlink ,store-path ,final-path)))))
files)))) files))))
(build-expression->derivation store name (%current-system) (build-expression->derivation store name (%current-system)

View file

@ -221,7 +221,8 @@ (define %coreutils
(let* ((files `(("x" . ,(search-path %load-path "ice-9/q.scm")) (let* ((files `(("x" . ,(search-path %load-path "ice-9/q.scm"))
("a/b/c" . ,(search-path %load-path ("a/b/c" . ,(search-path %load-path
"guix/derivations.scm")) "guix/derivations.scm"))
("p/q" . ,(search-path %load-path "guix.scm")))) ("p/q" . ,(search-path %load-path "guix.scm"))
("p/z" . ,(search-path %load-path "guix/store.scm"))))
(drv-path (imported-files %store files))) (drv-path (imported-files %store files)))
(and (build-derivations %store (list drv-path)) (and (build-derivations %store (list drv-path))
(let ((dir (derivation-path->output-path drv-path))) (let ((dir (derivation-path->output-path drv-path)))