about summary refs log tree commit diff
path: root/src/libstore/misc.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/misc.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/misc.cc')
-rw-r--r--src/libstore/misc.cc41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index 802e576512f1..b20879178805 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -27,44 +27,3 @@ void computeFSClosure(const Path & storePath,
          i != references.end(); ++i)
         computeFSClosure(*i, paths, flipDirection);
 }
-
-
-void storePathRequisites(const Path & storePath,
-    bool includeOutputs, PathSet & paths)
-{
-    checkInterrupt();
-    
-    if (paths.find(storePath) != paths.end()) return;
-
-    if (isDerivation(storePath)) {
-
-        paths.insert(storePath);
-        
-        Derivation drv = derivationFromPath(storePath);
-
-        for (DerivationInputs::iterator i = drv.inputDrvs.begin();
-             i != drv.inputDrvs.end(); ++i)
-            /* !!! Maybe this is too strict, since it will include
-               *all* output paths of the input derivation, not just
-               the ones needed by this derivation. */
-            storePathRequisites(i->first, includeOutputs, paths);
-
-        for (PathSet::iterator i = drv.inputSrcs.begin();
-             i != drv.inputSrcs.end(); ++i)
-            storePathRequisites(*i, includeOutputs, paths);
-
-        if (includeOutputs) {
-
-            for (DerivationOutputs::iterator i = drv.outputs.begin();
-                 i != drv.outputs.end(); ++i)
-                if (isValidPath(i->second.path))
-                    storePathRequisites(i->second.path, includeOutputs, paths);
-
-        }
-        
-    }
-
-    else {
-        computeFSClosure(storePath, paths);
-    }
-}