about summary refs log tree commit diff
path: root/src/nix-store
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-05-23T18·55-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-05-23T18·55-0400
commitb09b87321c058f691fcf64babe56620277b68e63 (patch)
treeaa1534bd47f8713206b718f7873fbadbb2ef2e5a /src/nix-store
parent107505e13ac83850fe01ef3e1a35e5bb2ab1ef52 (diff)
nix-store --export: Export paths in topologically sorted order
Fixes #118.
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/nix-store.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 151ed97e4b8b..5bd8558361df 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -694,7 +694,9 @@ static void opExport(Strings opFlags, Strings opArgs)
         else throw UsageError(format("unknown flag `%1%'") % *i);
 
     FdSink sink(STDOUT_FILENO);
-    exportPaths(*store, opArgs, sign, sink);
+    Paths sorted = topoSortPaths(*store, PathSet(opArgs.begin(), opArgs.end()));
+    reverse(sorted.begin(), sorted.end());
+    exportPaths(*store, sorted, sign, sink);
 }