From cf46f194445c9abc0398dae908295dff794fee98 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 2 Oct 2012 16:00:09 -0400 Subject: nix-store -r: Get rid of an unnecessary call to buildPaths/ensurePaths --- src/nix-store/nix-store.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 0ed8b6d74..b3f4ebdf5 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(path)); + if (build) store->buildPaths(singleton(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(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; } -- cgit v1.2.3