mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
Merge 33f18c6492 into 479b6b73a9
This commit is contained in:
commit
ec02f9702d
1 changed files with 28 additions and 25 deletions
|
|
@ -1737,27 +1737,6 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
|
||||||
dynamicOutputLock.lockPaths({store.toRealPath(finalDestPath)});
|
dynamicOutputLock.lockPaths({store.toRealPath(finalDestPath)});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move files, if needed */
|
|
||||||
if (store.toRealPath(finalDestPath) != actualPath) {
|
|
||||||
if (buildMode == bmRepair) {
|
|
||||||
/* Path already exists, need to replace it */
|
|
||||||
replaceValidPath(store.toRealPath(finalDestPath), actualPath);
|
|
||||||
} else if (buildMode == bmCheck) {
|
|
||||||
/* Path already exists, and we want to compare, so we leave out
|
|
||||||
new path in place. */
|
|
||||||
} else if (store.isValidPath(newInfo.path)) {
|
|
||||||
/* Path already exists because CA path produced by something
|
|
||||||
else. No moving needed. */
|
|
||||||
assert(newInfo.ca);
|
|
||||||
/* Can delete our scratch copy now. */
|
|
||||||
deletePath(actualPath);
|
|
||||||
} else {
|
|
||||||
auto destPath = store.toRealPath(finalDestPath);
|
|
||||||
deletePath(destPath);
|
|
||||||
movePath(actualPath, destPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (buildMode == bmCheck) {
|
if (buildMode == bmCheck) {
|
||||||
/* Check against already registered outputs */
|
/* Check against already registered outputs */
|
||||||
|
|
||||||
|
|
@ -1799,6 +1778,34 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
|
||||||
} else {
|
} else {
|
||||||
/* do tasks relating to registering these outputs */
|
/* do tasks relating to registering these outputs */
|
||||||
|
|
||||||
|
/* Move files, if needed */
|
||||||
|
if (store.toRealPath(finalDestPath) != actualPath) {
|
||||||
|
if (buildMode == bmRepair) {
|
||||||
|
/* Path already exists, need to replace it */
|
||||||
|
replaceValidPath(store.toRealPath(finalDestPath), actualPath);
|
||||||
|
/* Optimize store object we just replaced with new
|
||||||
|
(not-yet-optimized) data. */
|
||||||
|
store.optimisePath(
|
||||||
|
store.toRealPath(finalDestPath), NoRepair); // FIXME: combine with scanForReferences()
|
||||||
|
} else if (store.isValidPath(newInfo.path)) {
|
||||||
|
/* Path already exists because CA path produced by something
|
||||||
|
else. No moving needed. */
|
||||||
|
assert(newInfo.ca);
|
||||||
|
/* Can delete our scratch copy now. */
|
||||||
|
deletePath(actualPath);
|
||||||
|
/* Presume already-existing store object is already
|
||||||
|
optimized. */
|
||||||
|
} else {
|
||||||
|
auto destPath = store.toRealPath(finalDestPath);
|
||||||
|
deletePath(destPath);
|
||||||
|
movePath(actualPath, destPath);
|
||||||
|
/* Optimize store object we just installed from new
|
||||||
|
(not-yet-optimized) data. */
|
||||||
|
store.optimisePath(
|
||||||
|
store.toRealPath(finalDestPath), NoRepair); // FIXME: combine with scanForReferences()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* For debugging, print out the referenced and unreferenced paths. */
|
/* For debugging, print out the referenced and unreferenced paths. */
|
||||||
for (auto & i : inputPaths) {
|
for (auto & i : inputPaths) {
|
||||||
if (references.count(i))
|
if (references.count(i))
|
||||||
|
|
@ -1807,10 +1814,6 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
|
||||||
debug("unreferenced input: '%1%'", store.printStorePath(i));
|
debug("unreferenced input: '%1%'", store.printStorePath(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!store.isValidPath(newInfo.path))
|
|
||||||
store.optimisePath(
|
|
||||||
store.toRealPath(finalDestPath), NoRepair); // FIXME: combine with scanForReferences()
|
|
||||||
|
|
||||||
newInfo.deriver = drvPath;
|
newInfo.deriver = drvPath;
|
||||||
newInfo.ultimate = true;
|
newInfo.ultimate = true;
|
||||||
store.signPathInfo(newInfo);
|
store.signPathInfo(newInfo);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue