diff --git a/src/nix/installables.cc b/src/nix/installables.cc index 3cf4a6f8d..45517443c 100644 --- a/src/nix/installables.cc +++ b/src/nix/installables.cc @@ -183,20 +183,16 @@ std::vector> 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(installable)); + auto path = store->toStorePath(store->followLinksToStore(installable)); + + if (store->isStorePath(path)) { + if (isDerivation(path)) + result.push_back(std::make_shared(path)); else - result.push_back(std::make_shared(installable)); + result.push_back(std::make_shared(path)); } - - else { - result.push_back(std::make_shared( - store->toStorePath(store->followLinksToStore(installable)))); - } - } else if (installable.compare(0, 1, "(") == 0)