~ruther/guix-local

224f7ad6a3627df538a345ae3d3e8dd3494ecab2 — Ludovic Courtès 13 years ago d1b1c42
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.
2 files changed, 4 insertions(+), 2 deletions(-)

M guix/derivations.scm
M tests/derivations.scm
M guix/derivations.scm => guix/derivations.scm +2 -1
@@ 412,7 412,8 @@ system, imported, and appears under FINAL-PATH in the resulting store path."
                                                       `(false-if-exception
                                                         (mkdir ,d)))
                                                     head)
                                                `((mkdir ,tail)))))
                                                `((or (file-exists? ,tail)
                                                      (mkdir ,tail))))))
                                     `((symlink ,store-path ,final-path)))))
                           files))))
    (build-expression->derivation store name (%current-system)

M tests/derivations.scm => tests/derivations.scm +2 -1
@@ 221,7 221,8 @@
  (let* ((files    `(("x"     . ,(search-path %load-path "ice-9/q.scm"))
                     ("a/b/c" . ,(search-path %load-path
                                              "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)))
    (and (build-derivations %store (list drv-path))
         (let ((dir (derivation-path->output-path drv-path)))