mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 16:23:02 +00:00
Merge pull request #8015 from tweag/progress-during-nix-copy
Display progress when running copyPaths (nix copy)
This commit is contained in:
commit
99af56cd0d
@ -1101,6 +1101,8 @@ std::map<StorePath, StorePath> copyPaths(
|
||||
return storePathForDst;
|
||||
};
|
||||
|
||||
uint64_t total = 0;
|
||||
|
||||
for (auto & missingPath : sortedMissing) {
|
||||
auto info = srcStore.queryPathInfo(missingPath);
|
||||
|
||||
@ -1121,7 +1123,13 @@ std::map<StorePath, StorePath> copyPaths(
|
||||
{storePathS, srcUri, dstUri});
|
||||
PushActivity pact(act.id);
|
||||
|
||||
srcStore.narFromPath(missingPath, sink);
|
||||
LambdaSink progressSink([&](std::string_view data) {
|
||||
total += data.size();
|
||||
act.progress(total, info->narSize);
|
||||
});
|
||||
TeeSink tee { sink, progressSink };
|
||||
|
||||
srcStore.narFromPath(missingPath, tee);
|
||||
});
|
||||
pathsToCopy.push_back(std::pair{infoForDst, std::move(source)});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user