summary refs log tree commit diff
path: root/gnu/system/vm.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-12-07 16:16:01 +0100
committerLudovic Courtès <ludo@gnu.org>2013-12-07 16:16:01 +0100
commitf0387dd1676bdcb08e005cede98de7dedbd82bad (patch)
tree62a337f2de74644880b9fae4a0f13a89a8719d5f /gnu/system/vm.scm
parent18fb40e414d000b5f342b009a9fbfdc69afb704e (diff)
downloadguix-f0387dd1676bdcb08e005cede98de7dedbd82bad.tar.gz
gnu: vm: Fix inputs in 'file-union'.
* gnu/system/vm.scm (file-union): Filter out members of FILES that are
  outputs of INPUTS.
Diffstat (limited to 'gnu/system/vm.scm')
-rw-r--r--gnu/system/vm.scm23
1 files changed, 18 insertions, 5 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 16be5ac59a..e89815225e 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -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
 as an inputs; additional inputs, such as derivations, are taken from INPUTS."
   (mlet %store-monad ((inputs (lower-inputs inputs)))
-    (let ((inputs (append inputs
-                          (filter (match-lambda
-                                   ((_ file)
-                                    (direct-store-path? file)))
-                                  files))))
+    (let* ((outputs (append-map (match-lambda
+                                 ((_ (? derivation? drv))
+                                  (list (derivation->output-path drv)))
+                                 ((_ (? derivation? drv) sub-drv ...)
+                                  (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
                              `(let ((out (assoc-ref %outputs "out")))
                                 (mkdir out)