about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-01-25T21·28+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-01-25T21·28+0000
commita24b78e9f1a7326badb6c38d5d63aeb6ccdf9970 (patch)
treef1d9a3fde9ab4f70e78152263d69afc29da6e393 /src/libstore/build.cc
parent2a2756b85643de6355b7b9e3cc47574e7df82303 (diff)
* Maintain the references/referers relation also for derivations.
  This simplifies garbage collection and `nix-store --query
  --requisites' since we no longer need to treat derivations
  specially.

* Better maintaining of the invariants, e.g., setReferences() can only
  be called on a valid/substitutable path.

Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index e5089bdb4515..b63488b8de61 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1135,8 +1135,7 @@ void DerivationGoal::computeClosure()
          i != drv.outputs.end(); ++i)
     {
         registerValidPath(txn, i->second.path,
-            contentHashes[i->second.path]);
-        setReferences(txn, i->second.path,
+            contentHashes[i->second.path],
             allReferences[i->second.path]);
     }
     txn.commit();
@@ -1494,7 +1493,7 @@ void SubstitutionGoal::finished()
 
     Transaction txn;
     createStoreTransaction(txn);
-    registerValidPath(txn, storePath, contentHash);
+    registerValidPath(txn, storePath, contentHash, references);
     txn.commit();
 
     outputLock->setDeletion(true);