* Allow the output/expression id to be forced to a certain

value; this potentially dangerous feature enables better 
  sharing for those paths for which the content is known in 
  advance (e.g., because a content hash is given).
* Fast builds: if we can expand all output paths of a derive 
  expression, we don't have to build.
This commit is contained in:
Eelco Dolstra 2003-07-21 20:07:12 +00:00
parent 49231fbe41
commit 249988a787
6 changed files with 23 additions and 17 deletions

View file

@ -31,9 +31,10 @@ ATerm termFromId(const FSId & id)
}
FSId writeTerm(ATerm t, const string & suffix)
FSId writeTerm(ATerm t, const string & suffix, FSId id)
{
FSId id = hashTerm(t);
/* By default, the id of a term is its hash. */
if (id == FSId()) id = hashTerm(t);
string path = canonPath(nixStore + "/" +
(string) id + suffix + ".nix");