mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 04:00:59 +01:00
* Maintain the references graph again.
* Only build a derivation if there are no trusted output paths in the equivalence classes for that derivation's outputs. * Set the trust ID to the current user name, or use the value of the NIX_USER_ID environment variable.
This commit is contained in:
parent
75454567f7
commit
89635e16ba
14 changed files with 179 additions and 162 deletions
|
|
@ -29,13 +29,23 @@ void computeFSClosure(const Path & storePath,
|
|||
}
|
||||
|
||||
|
||||
Path findOutput(const Derivation & drv, string id)
|
||||
OutputEqClass findOutputEqClass(const Derivation & drv, const string & id)
|
||||
{
|
||||
assert(0);
|
||||
#if 0
|
||||
for (DerivationOutputs::const_iterator i = drv.outputs.begin();
|
||||
i != drv.outputs.end(); ++i)
|
||||
if (i->first == id) return i->second.path;
|
||||
throw Error(format("derivation has no output `%1%'") % id);
|
||||
#endif
|
||||
DerivationOutputs::const_iterator i = drv.outputs.find(id);
|
||||
if (i == drv.outputs.end())
|
||||
throw Error(format("derivation has no output `%1%'") % id);
|
||||
return i->second.eqClass;
|
||||
}
|
||||
|
||||
|
||||
Path findTrustedEqClassMember(const OutputEqClass & eqClass,
|
||||
const TrustId & trustId)
|
||||
{
|
||||
OutputEqMembers members;
|
||||
queryOutputEqMembers(noTxn, eqClass, members);
|
||||
|
||||
for (OutputEqMembers::iterator j = members.begin(); j != members.end(); ++j)
|
||||
if (j->trustId == trustId || j->trustId == "root") return j->path;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue