From 05f0430de1d8eeae222a1306d4d0f7f407c8ce7d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 20 Jan 2005 14:10:19 +0000 Subject: * 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. --- src/libexpr/primops.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/libexpr/primops.cc') 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"); -- cgit 1.4.1