forked from lix-project/lix
nix path-info -r: Don't duplicate the root paths
This fixes $ nix path-info -r $(type -P ls) /nix/store/vfilzcp8a467w3p0mp54ybq6bdzb8w49-coreutils-8.32 /nix/store/5d821pjgzb90lw4zbg6xwxs7llm335wr-libunistring-0.9.10 ... /nix/store/mrv4y369nw6hg4pw8d9p9bfdxj9pjw0x-acl-2.3.0 /nix/store/vfilzcp8a467w3p0mp54ybq6bdzb8w49-coreutils-8.32 Also, output the paths in topologically sorted order like we used to.
This commit is contained in:
parent
a15e65eef0
commit
4b2b151131
|
@ -120,7 +120,7 @@ void BuiltPathsCommand::run(ref<Store> store)
|
||||||
// XXX: This only computes the store path closure, ignoring
|
// XXX: This only computes the store path closure, ignoring
|
||||||
// intermediate realisations
|
// intermediate realisations
|
||||||
StorePathSet pathsRoots, pathsClosure;
|
StorePathSet pathsRoots, pathsClosure;
|
||||||
for (auto & root: paths) {
|
for (auto & root : paths) {
|
||||||
auto rootFromThis = root.outPaths();
|
auto rootFromThis = root.outPaths();
|
||||||
pathsRoots.insert(rootFromThis.begin(), rootFromThis.end());
|
pathsRoots.insert(rootFromThis.begin(), rootFromThis.end());
|
||||||
}
|
}
|
||||||
|
@ -140,12 +140,15 @@ StorePathsCommand::StorePathsCommand(bool recursive)
|
||||||
|
|
||||||
void StorePathsCommand::run(ref<Store> store, BuiltPaths && paths)
|
void StorePathsCommand::run(ref<Store> store, BuiltPaths && paths)
|
||||||
{
|
{
|
||||||
StorePaths storePaths;
|
StorePathSet storePaths;
|
||||||
for (auto& builtPath : paths)
|
for (auto & builtPath : paths)
|
||||||
for (auto& p : builtPath.outPaths())
|
for (auto & p : builtPath.outPaths())
|
||||||
storePaths.push_back(p);
|
storePaths.insert(p);
|
||||||
|
|
||||||
run(store, std::move(storePaths));
|
auto sorted = store->topoSortPaths(storePaths);
|
||||||
|
std::reverse(sorted.begin(), sorted.end());
|
||||||
|
|
||||||
|
run(store, std::move(sorted));
|
||||||
}
|
}
|
||||||
|
|
||||||
void StorePathCommand::run(ref<Store> store, std::vector<StorePath> && storePaths)
|
void StorePathCommand::run(ref<Store> store, std::vector<StorePath> && storePaths)
|
||||||
|
|
Loading…
Reference in a new issue