mirror of
https://github.com/NixOS/nix.git
synced 2025-11-12 21:46:01 +01:00
Factor out --from / --to logic
This commit is contained in:
parent
f6f0bcf11f
commit
6448ea84ab
3 changed files with 66 additions and 44 deletions
|
|
@ -176,6 +176,23 @@ public:
|
|||
bool useDefaultInstallables() override { return !all; }
|
||||
};
|
||||
|
||||
/* A command that copies something between `--from` and `--to`
|
||||
stores. */
|
||||
struct CopyCommand : virtual BuiltPathsCommand
|
||||
{
|
||||
std::string srcUri, dstUri;
|
||||
|
||||
CopyCommand();
|
||||
|
||||
ref<Store> createStore() override;
|
||||
|
||||
void run(ref<Store> store) override;
|
||||
|
||||
void run(ref<Store> srcStore, BuiltPaths && paths) override;
|
||||
|
||||
virtual void run(ref<Store> srcStore, ref<Store> dstStore, BuiltPaths && paths) = 0;
|
||||
};
|
||||
|
||||
struct StorePathsCommand : public BuiltPathsCommand
|
||||
{
|
||||
StorePathsCommand(bool recursive = false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue