Fix root creation when the root already exists but is owned by another user
This commit is contained in:
@ -264,7 +264,7 @@ State::StepResult State::doBuildStep(nix::ref<Store> destStore,
|
||||
assert(stepNr);
|
||||
|
||||
for (auto & path : step->drv.outputPaths())
|
||||
writeFile(rootsDir + "/" + baseNameOf(path), "");
|
||||
addRoot(path);
|
||||
|
||||
/* Register success in the database for all Build objects that
|
||||
have this step as the top-level step. Since the queue
|
||||
@ -473,3 +473,10 @@ State::StepResult State::doBuildStep(nix::ref<Store> destStore,
|
||||
|
||||
return sDone;
|
||||
}
|
||||
|
||||
|
||||
void State::addRoot(const Path & storePath)
|
||||
{
|
||||
auto root = rootsDir + "/" + baseNameOf(storePath);
|
||||
if (!pathExists(root)) writeFile(root, "");
|
||||
}
|
||||
|
Reference in New Issue
Block a user