about summary refs log tree commit diff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-13T16·03+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-13T16·03+0200
commita010c0ae0545babccb054f8f726b864b7cff0dcb (patch)
treef78adce04c3ae2efaa71d02c708e5667428e9111 /src/nix-store/nix-store.cc
parent9233ac7c565bd370fee8681414461bda2558fa07 (diff)
Fix "error: deriver of path ‘’ is not known"
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 60080f253a22..506c1a397b55 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -49,12 +49,11 @@ LocalStore & ensureLocalStore()
 
 static Path useDeriver(Path path)
 {
-    if (!isDerivation(path)) {
-        path = store->queryDeriver(path);
-        if (path == "")
-            throw Error(format("deriver of path ‘%1%’ is not known") % path);
-    }
-    return path;
+    if (isDerivation(path)) return path;
+    Path drvPath = store->queryDeriver(path);
+    if (drvPath == "")
+        throw Error(format("deriver of path ‘%1%’ is not known") % path);
+    return drvPath;
 }