mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
Separate dstStore path from srcStore path
This commit is contained in:
parent
2f2ac850b5
commit
9077b9e6b2
1 changed files with 24 additions and 6 deletions
|
@ -649,15 +649,24 @@ void copyPaths(ref<Store> srcStore, ref<Store> dstStore, const StorePathSet & st
|
||||||
processGraph<Path>(pool,
|
processGraph<Path>(pool,
|
||||||
PathSet(missing.begin(), missing.end()),
|
PathSet(missing.begin(), missing.end()),
|
||||||
|
|
||||||
[&](const Path & storePath) {
|
[&](const Path & storePathS) {
|
||||||
if (dstStore->isValidPath(dstStore->parseStorePath(storePath))) {
|
auto storePath = srcStore->parseStorePath(storePathS);
|
||||||
|
|
||||||
|
auto info = srcStore->queryPathInfo(storePath);
|
||||||
|
auto storePathForDst = storePath.clone();
|
||||||
|
if (hasPrefix(info->ca, "fixed:"))
|
||||||
|
{
|
||||||
|
FileIngestionMethod ingestionMethod { info->ca.compare(6, 2, "r:") == 0 };
|
||||||
|
Hash hash(std::string(info->ca, ingestionMethod == FileIngestionMethod::Recursive ? 8 : 6));
|
||||||
|
storePathForDst = dstStore->makeFixedOutputPath(ingestionMethod, hash, storePath.name());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dstStore->isValidPath(storePathForDst)) {
|
||||||
nrDone++;
|
nrDone++;
|
||||||
showProgress();
|
showProgress();
|
||||||
return PathSet();
|
return PathSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto info = srcStore->queryPathInfo(srcStore->parseStorePath(storePath));
|
|
||||||
|
|
||||||
bytesExpected += info->narSize;
|
bytesExpected += info->narSize;
|
||||||
act.setExpected(actCopyPath, bytesExpected);
|
act.setExpected(actCopyPath, bytesExpected);
|
||||||
|
|
||||||
|
@ -667,9 +676,18 @@ void copyPaths(ref<Store> srcStore, ref<Store> dstStore, const StorePathSet & st
|
||||||
[&](const Path & storePathS) {
|
[&](const Path & storePathS) {
|
||||||
checkInterrupt();
|
checkInterrupt();
|
||||||
|
|
||||||
auto storePath = dstStore->parseStorePath(storePathS);
|
auto storePath = srcStore->parseStorePath(storePathS);
|
||||||
|
auto info = srcStore->queryPathInfo(storePath);
|
||||||
|
|
||||||
if (!dstStore->isValidPath(storePath)) {
|
auto storePathForDst = storePath.clone();
|
||||||
|
if (hasPrefix(info->ca, "fixed:"))
|
||||||
|
{
|
||||||
|
FileIngestionMethod ingestionMethod { info->ca.compare(6, 2, "r:") == 0 };
|
||||||
|
Hash hash(std::string(info->ca, ingestionMethod == FileIngestionMethod::Recursive ? 8 : 6));
|
||||||
|
storePathForDst = dstStore->makeFixedOutputPath(ingestionMethod, hash, storePath.name());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!dstStore->isValidPath(storePathForDst)) {
|
||||||
MaintainCount<decltype(nrRunning)> mc(nrRunning);
|
MaintainCount<decltype(nrRunning)> mc(nrRunning);
|
||||||
showProgress();
|
showProgress();
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue