diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-20T14·10+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-20T14·10+0000 |
commit | 05f0430de1d8eeae222a1306d4d0f7f407c8ce7d (patch) | |
tree | 2bd947476885025bd52f61430c269398008fb093 /src/libexpr | |
parent | 6ff48e77f6da3c523a29c254b315d83e310290b3 (diff) |
* Another change to low-level derivations. The last one this year, I
promise :-) This allows derivations to specify on *what* output paths of input derivations they are dependent. This helps to prevent unnecessary downloads. For instance, a build might be dependent on the `devel' and `lib' outputs of some library component, but not the `docs' output.
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/primops.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 9335ee3138a4..f10597557203 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -68,17 +68,17 @@ static Hash hashDerivationModulo(EvalState & state, Derivation drv) /* For other derivations, replace the inputs paths with recursive calls to this function.*/ - PathSet inputs2; - for (PathSet::iterator i = drv.inputDrvs.begin(); + DerivationInputs inputs2; + for (DerivationInputs::iterator i = drv.inputDrvs.begin(); i != drv.inputDrvs.end(); ++i) { - Hash h = state.drvHashes[*i]; + Hash h = state.drvHashes[i->first]; if (h.type == htUnknown) { - Derivation drv2 = derivationFromPath(*i); + Derivation drv2 = derivationFromPath(i->first); h = hashDerivationModulo(state, drv2); - state.drvHashes[*i] = h; + state.drvHashes[i->first] = h; } - inputs2.insert(printHash(h)); + inputs2[printHash(h)] = i->second; } drv.inputDrvs = inputs2; @@ -119,7 +119,9 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv, /* !!! supports only single output path */ Path outPath = evalPath(state, a); - drv.inputDrvs.insert(drvPath); + StringSet ids; + ids.insert("out"); + drv.inputDrvs[drvPath] = ids; ss.push_back(outPath); } else throw Error("invalid derivation attribute"); |