about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libstore/remote-store.cc1
-rw-r--r--src/nix-store/nix-store.cc4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index f566ccf53122..3b021bb2a50c 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -35,7 +35,6 @@ template<class T> T readStorePaths(Source & from)
 }
 
 template PathSet readStorePaths(Source & from);
-template Paths readStorePaths(Source & from);
 
 
 RemoteStore::RemoteStore()
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 0196c2fc1873..048f5c603008 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -992,7 +992,9 @@ static void opServe(Strings opFlags, Strings opArgs)
             }
 
             case cmdExportPaths: {
-                exportPaths(*store, readStorePaths<Paths>(in), false, out);
+                Paths sorted = topoSortPaths(*store, readStorePaths<PathSet>(in));
+                reverse(sorted.begin(), sorted.end());
+                exportPaths(*store, sorted, false, out);
                 break;
             }