about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nix/installables.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index 3cf4a6f8d32b..45517443ca32 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -183,20 +183,16 @@ std::vector<std::shared_ptr<Installable>> InstallablesCommand::parseInstallables
 
     for (auto & installable : installables) {
 
-        if (std::string(installable, 0, 1) == "/") {
+        if (installable.find("/") != std::string::npos) {
 
-            if (store->isStorePath(installable)) {
-                if (isDerivation(installable))
-                    result.push_back(std::make_shared<InstallableStoreDrv>(installable));
-                else
-                    result.push_back(std::make_shared<InstallableStorePath>(installable));
-            }
+            auto path = store->toStorePath(store->followLinksToStore(installable));
 
-            else {
-                result.push_back(std::make_shared<InstallableStorePath>(
-                        store->toStorePath(store->followLinksToStore(installable))));
+            if (store->isStorePath(path)) {
+                if (isDerivation(path))
+                    result.push_back(std::make_shared<InstallableStoreDrv>(path));
+                else
+                    result.push_back(std::make_shared<InstallableStorePath>(path));
             }
-
         }
 
         else if (installable.compare(0, 1, "(") == 0)