aboutsummaryrefslogtreecommitdiff
path: root/src/nix/copy.cc
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2020-12-14 19:43:53 +0100
committerregnat <rg@regnat.ovh>2021-02-25 17:18:48 +0100
commit2e199673a523fa81de31ffdd2a25976ce0814631 (patch)
tree0fb1d53de185add0561cf4915ceab626f55c0227 /src/nix/copy.cc
parentc189031e8be0530d73a817571ad7f81ad5eedce6 (diff)
Use `RealisedPath`s in `copyPaths`
That way we can copy the realisations too (in addition to the store paths themselves)
Diffstat (limited to 'src/nix/copy.cc')
-rw-r--r--src/nix/copy.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nix/copy.cc b/src/nix/copy.cc
index c56a1def1..f59f7c76b 100644
--- a/src/nix/copy.cc
+++ b/src/nix/copy.cc
@@ -8,7 +8,7 @@
using namespace nix;
-struct CmdCopy : StorePathsCommand
+struct CmdCopy : RealisedPathsCommand
{
std::string srcUri, dstUri;
@@ -16,10 +16,10 @@ struct CmdCopy : StorePathsCommand
SubstituteFlag substitute = NoSubstitute;
- using StorePathsCommand::run;
+ using RealisedPathsCommand::run;
CmdCopy()
- : StorePathsCommand(true)
+ : RealisedPathsCommand(true)
{
addFlag({
.longName = "from",
@@ -75,14 +75,15 @@ struct CmdCopy : StorePathsCommand
if (srcUri.empty() && dstUri.empty())
throw UsageError("you must pass '--from' and/or '--to'");
- StorePathsCommand::run(store);
+ RealisedPathsCommand::run(store);
}
- void run(ref<Store> srcStore, StorePaths storePaths) override
+ void run(ref<Store> srcStore, std::vector<RealisedPath> paths) override
{
ref<Store> dstStore = dstUri.empty() ? openStore() : openStore(dstUri);
- copyPaths(srcStore, dstStore, StorePathSet(storePaths.begin(), storePaths.end()),
+ copyPaths(
+ srcStore, dstStore, RealisedPath::Set(paths.begin(), paths.end()),
NoRepair, checkSigs, substitute);
}
};