about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-02T20·00-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-02T20·00-0400
commitcf46f194445c9abc0398dae908295dff794fee98 (patch)
tree0a8339988e2f301a185c9a88124cee54a08343e6
parent8e3a7bd71253f02eb1a9fbb996166727b1283887 (diff)
nix-store -r: Get rid of an unnecessary call to buildPaths/ensurePaths
-rw-r--r--src/nix-store/nix-store.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 0ed8b6d74b7c..b3f4ebdf568c 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -59,10 +59,10 @@ static Path useDeriver(Path path)
 
 /* Realise the given path.  For a derivation that means build it; for
    other paths it means ensure their validity. */
-static PathSet realisePath(const Path & path)
+static PathSet realisePath(const Path & path, bool build = true)
 {
     if (isDerivation(path)) {
-        store->buildPaths(singleton<PathSet>(path));
+        if (build) store->buildPaths(singleton<PathSet>(path));
         Derivation drv = derivationFromPath(*store, path);
         rootNr++;
 
@@ -83,7 +83,7 @@ static PathSet realisePath(const Path & path)
     }
 
     else {
-        store->ensurePath(path);
+        if (build) store->ensurePath(path);
         return singleton<PathSet>(path);
     }
 }
@@ -110,7 +110,7 @@ static void opRealise(Strings opFlags, Strings opArgs)
     store->buildPaths(paths);
 
     foreach (Paths::iterator, i, opArgs) {
-        PathSet paths = realisePath(*i);
+        PathSet paths = realisePath(*i, false);
         foreach (PathSet::iterator, j, paths)
             cout << format("%1%\n") % *j;
     }