about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-10T14·17+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-10T14·17+0200
commitb65875f8595ba6d72c6d6a5de2eba4e9f3c9b6f5 (patch)
tree2fba1f572e7381cefe9f8f9e5fd21ad28a776a29 /src
parentf90e9b65d67023d0deb158b87654ac692066552f (diff)
Export outputPaths function
This is useful for the new hydra-queue-runner.
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build.cc13
-rw-r--r--src/libstore/derivations.cc9
-rw-r--r--src/libstore/derivations.hh1
3 files changed, 12 insertions, 11 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 5bd745454abe..21bf7167e523 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1187,15 +1187,6 @@ void DerivationGoal::inputsRealised()
 }
 
 
-PathSet outputPaths(const DerivationOutputs & outputs)
-{
-    PathSet paths;
-    foreach (DerivationOutputs::const_iterator, i, outputs)
-        paths.insert(i->second.path);
-    return paths;
-}
-
-
 static bool canBuildLocally(const string & platform)
 {
     return platform == settings.thisSystem
@@ -1247,7 +1238,7 @@ void DerivationGoal::tryToBuild()
        can't acquire the lock, then continue; hopefully some other
        goal can start a build, and if not, the main loop will sleep a
        few seconds and then retry this goal. */
-    if (!outputLocks.lockPaths(outputPaths(drv.outputs), "", false)) {
+    if (!outputLocks.lockPaths(outputPaths(drv), "", false)) {
         worker.waitForAWhile(shared_from_this());
         return;
     }
@@ -1268,7 +1259,7 @@ void DerivationGoal::tryToBuild()
         return;
     }
 
-    missingPaths = outputPaths(drv.outputs);
+    missingPaths = outputPaths(drv);
     if (buildMode != bmCheck)
         foreach (PathSet::iterator, i, validPaths) missingPaths.erase(*i);
 
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index 7234ae5630ed..fbc1d99f3d6f 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -285,4 +285,13 @@ bool wantOutput(const string & output, const std::set<string> & wanted)
 }
 
 
+PathSet outputPaths(const Derivation & drv)
+{
+    PathSet paths;
+    for (auto & i : drv.outputs)
+        paths.insert(i.second.path);
+    return paths;
+}
+
+
 }
diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh
index 04b64dfc88a7..8d5e4d05d469 100644
--- a/src/libstore/derivations.hh
+++ b/src/libstore/derivations.hh
@@ -89,5 +89,6 @@ Path makeDrvPathWithOutputs(const Path & drvPath, const std::set<string> & outpu
 
 bool wantOutput(const string & output, const std::set<string> & wanted);
 
+PathSet outputPaths(const Derivation & drv);
 
 }