daemon: 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

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Eelco Dolstra 2016-01-06 21:49:32 +01:00 committed by Ludovic Courtès
parent 63a5be07e2
commit 1a9574e3a7
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -1106,8 +1106,10 @@ void DerivationGoal::repairClosure()
/* Get the output closure. */
PathSet outputClosure;
foreach (DerivationOutputs::iterator, i, drv.outputs)
foreach (DerivationOutputs::iterator, 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). */
foreach (DerivationOutputs::iterator, i, drv.outputs)