aboutsummaryrefslogtreecommitdiff
path: root/src/nix/command.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/command.cc')
-rw-r--r--src/nix/command.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nix/command.cc b/src/nix/command.cc
index 9dbc3685a..442bc6c53 100644
--- a/src/nix/command.cc
+++ b/src/nix/command.cc
@@ -48,28 +48,29 @@ StorePathsCommand::StorePathsCommand(bool recursive)
void StorePathsCommand::run(ref<Store> store)
{
- Paths storePaths;
+ StorePaths storePaths;
if (all) {
if (installables.size())
throw UsageError("'--all' does not expect arguments");
for (auto & p : store->queryAllValidPaths())
- storePaths.push_back(p);
+ storePaths.push_back(p.clone());
}
else {
for (auto & p : toStorePaths(store, realiseMode, installables))
- storePaths.push_back(p);
+ storePaths.push_back(p.clone());
if (recursive) {
- PathSet closure;
- store->computeFSClosure(PathSet(storePaths.begin(), storePaths.end()),
- closure, false, false);
- storePaths = Paths(closure.begin(), closure.end());
+ StorePathSet closure;
+ store->computeFSClosure(storePathsToSet(storePaths), closure, false, false);
+ storePaths.clear();
+ for (auto & p : closure)
+ storePaths.push_back(p.clone());
}
}
- run(store, storePaths);
+ run(store, std::move(storePaths));
}
void StorePathCommand::run(ref<Store> store)