aboutsummaryrefslogtreecommitdiff
path: root/src/nix-copy-closure
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-copy-closure')
-rwxr-xr-xsrc/nix-copy-closure/nix-copy-closure.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/nix-copy-closure/nix-copy-closure.cc b/src/nix-copy-closure/nix-copy-closure.cc
index b10184718..841d50fd3 100755
--- a/src/nix-copy-closure/nix-copy-closure.cc
+++ b/src/nix-copy-closure/nix-copy-closure.cc
@@ -1,10 +1,10 @@
#include "shared.hh"
#include "store-api.hh"
-#include "../nix/legacy.hh"
+#include "legacy.hh"
using namespace nix;
-static int _main(int argc, char ** argv)
+static int main_nix_copy_closure(int argc, char ** argv)
{
{
auto gzip = false;
@@ -43,8 +43,6 @@ static int _main(int argc, char ** argv)
return true;
});
- initPlugins();
-
if (sshHost.empty())
throw UsageError("no host name specified");
@@ -52,17 +50,14 @@ static int _main(int argc, char ** argv)
auto to = toMode ? openStore(remoteUri) : openStore();
auto from = toMode ? openStore() : openStore(remoteUri);
- StorePathSet storePaths2;
+ RealisedPath::Set storePaths2;
for (auto & path : storePaths)
storePaths2.insert(from->followLinksToStorePath(path));
- StorePathSet closure;
- from->computeFSClosure(storePaths2, closure, false, includeOutputs);
-
- copyPaths(from, to, closure, NoRepair, NoCheckSigs, useSubstitutes);
+ copyClosure(*from, *to, storePaths2, NoRepair, NoCheckSigs, useSubstitutes);
return 0;
}
}
-static RegisterLegacyCommand s1("nix-copy-closure", _main);
+static RegisterLegacyCommand r_nix_copy_closure("nix-copy-closure", main_nix_copy_closure);