From 249988a787d26046bf7b389594ff25029229e3d9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 21 Jul 2003 20:07:12 +0000 Subject: * 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. --- src/fstate.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/fstate.cc') 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"); -- cgit 1.4.1