1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 05:11:47 +02:00

* `nix-store -qR' and friends: print the paths sorted topologically

under the references relation.  This is useful for commands that
  want to copy paths to another Nix store in the right order.
This commit is contained in:
Eelco Dolstra 2007-02-21 22:45:10 +00:00
parent 881feb9698
commit 9da367b7d5
3 changed files with 12 additions and 40 deletions

View file

@ -417,7 +417,7 @@ static void dfsVisit(const PathSet & paths, const Path & path,
}
static Paths topoSort(const PathSet & paths)
Paths topoSortPaths(const PathSet & paths)
{
Paths sorted;
PathSet visited;
@ -550,7 +550,7 @@ void LocalStore::collectGarbage(GCAction action, const PathSet & pathsToDelete,
which things can be deleted safely. */
/* !!! when we have multiple output paths per derivation, this
will not work anymore because we get cycles. */
Paths storePaths = topoSort(storePathSet);
Paths storePaths = topoSortPaths(storePathSet);
/* Try to delete store paths in the topologically sorted order. */
for (Paths::iterator i = storePaths.begin(); i != storePaths.end(); ++i) {