gnu: vm: Fix inputs in 'file-union'.

* gnu/system/vm.scm (file-union): Filter out members of FILES that are
  outputs of INPUTS.
master
Ludovic Courtès 2013-12-07 16:16:01 +01:00
parent 18fb40e414
commit f0387dd167
1 changed files with 18 additions and 5 deletions

View File

@ -467,11 +467,24 @@ in the new directory, and the second element is the target file.
The subset of FILES corresponding to plain store files is automatically added The subset of FILES corresponding to plain store files is automatically added
as an inputs; additional inputs, such as derivations, are taken from INPUTS." as an inputs; additional inputs, such as derivations, are taken from INPUTS."
(mlet %store-monad ((inputs (lower-inputs inputs))) (mlet %store-monad ((inputs (lower-inputs inputs)))
(let ((inputs (append inputs (let* ((outputs (append-map (match-lambda
(filter (match-lambda ((_ (? derivation? drv))
((_ file) (list (derivation->output-path drv)))
(direct-store-path? file))) ((_ (? derivation? drv) sub-drv ...)
files)))) (map (cut derivation->output-path drv <>)
sub-drv))
(_ '()))
inputs))
(inputs (append inputs
(filter (match-lambda
((_ file)
;; Elements of FILES that are store
;; files and that do not correspond to
;; the output of INPUTS are considered
;; inputs (still here?).
(and (direct-store-path? file)
(not (member file outputs)))))
files))))
(derivation-expression name (derivation-expression name
`(let ((out (assoc-ref %outputs "out"))) `(let ((out (assoc-ref %outputs "out")))
(mkdir out) (mkdir out)