about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-01-06T20·49+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-01-06T20·49+0100
commitcaaaff3954a164155f1ee2be8a29f50cd76d1717 (patch)
tree8e1e88f487ad91820ebc9d014d675b9efbc93bf2 /src/libstore
parentd2c0958e1e4f2e377f39687119814ec3808f31d4 (diff)
Fix --repair failure on multiple-output derivations
If repair found a corrupted/missing path that depended on a
multiple-output derivation, and some of the outputs of the latter were
not present, it failed with a message like

  error: path ‘/nix/store/cnfn9d5fjys1y93cz9shld2xwaibd7nn-bash-4.3-p42-doc’ is not valid
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index b41daac99159..931b0755bf31 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1123,8 +1123,10 @@ void DerivationGoal::repairClosure()
 
     /* Get the output closure. */
     PathSet outputClosure;
-    for (auto & i : drv->outputs)
+    for (auto & i : drv->outputs) {
+        if (!wantOutput(i.first, wantedOutputs)) continue;
         computeFSClosure(worker.store, i.second.path, outputClosure);
+    }
 
     /* Filter out our own outputs (which we have already checked). */
     for (auto & i : drv->outputs)