diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-21T20·07+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-21T20·07+0000 |
commit | 249988a787d26046bf7b389594ff25029229e3d9 (patch) | |
tree | 6d44fafeb9979c0dee57706d8d0dcb64d9e13bc8 /src/fstate.cc | |
parent | 49231fbe419d37717b0d951377fbfc9bf445dd55 (diff) |
* 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.
Diffstat (limited to 'src/fstate.cc')
-rw-r--r-- | src/fstate.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fstate.cc b/src/fstate.cc index 85f8c75cc5bc..1c8c6776f1ed 100644 --- a/src/fstate.cc +++ b/src/fstate.cc @@ -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"); |