mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 06:42:28 +00:00
* Remove obstructing invalid store paths add[Text]ToStore().
This commit is contained in:
parent
daf0a923c7
commit
be1a917beb
@ -401,6 +401,9 @@ Path addToStore(const Path & _srcPath)
|
||||
PathLocks outputLock(lockPaths);
|
||||
|
||||
if (!isValidPath(dstPath)) {
|
||||
|
||||
if (pathExists(dstPath)) deletePath(dstPath);
|
||||
|
||||
copyPath(srcPath, dstPath);
|
||||
|
||||
Transaction txn(nixDB);
|
||||
@ -426,6 +429,9 @@ void addTextToStore(const Path & dstPath, const string & s)
|
||||
PathLocks outputLock(lockPaths);
|
||||
|
||||
if (!isValidPath(dstPath)) {
|
||||
|
||||
if (pathExists(dstPath)) deletePath(dstPath);
|
||||
|
||||
writeStringToFile(dstPath, s);
|
||||
|
||||
Transaction txn(nixDB);
|
||||
|
Loading…
Reference in New Issue
Block a user