about summary refs log tree commit diff
path: root/src/libstore/gc.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-02-22T12·44+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-02-22T12·44+0000
commitc4d388add4942f6f99a8df12f4e49149005047e2 (patch)
tree910f35306dbf6d78898d6c3968bcc039db187655 /src/libstore/gc.cc
parent103cfee056cbc8f002929fd5958e305c1a75fe45 (diff)
* Get derivation outputs from the database instead of the .drv file,
  which requires more I/O.

Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r--src/libstore/gc.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index 659c636e3d..cf073c5d9a 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -467,10 +467,10 @@ bool LocalStore::tryToDelete(GCState & state, const Path & path)
            then don't delete the derivation if any of the outputs are
            live. */
         if (state.gcKeepDerivations && isDerivation(path)) {
-            Derivation drv = derivationFromPath(path);
-            foreach (DerivationOutputs::iterator, i, drv.outputs)
-                if (!tryToDelete(state, i->second.path)) {
-                    printMsg(lvlDebug, format("cannot delete derivation `%1%' because its output is alive") % path);
+            PathSet outputs = queryDerivationOutputs(path);
+            foreach (PathSet::iterator, i, outputs)
+                if (!tryToDelete(state, *i)) {
+                    printMsg(lvlDebug, format("cannot delete derivation `%1%' because its output `%2%' is alive") % path % *i);
                     goto isLive;
                 }
         }