forked from lix-project/lix
* 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);
|
PathLocks outputLock(lockPaths);
|
||||||
|
|
||||||
if (!isValidPath(dstPath)) {
|
if (!isValidPath(dstPath)) {
|
||||||
|
|
||||||
|
if (pathExists(dstPath)) deletePath(dstPath);
|
||||||
|
|
||||||
copyPath(srcPath, dstPath);
|
copyPath(srcPath, dstPath);
|
||||||
|
|
||||||
Transaction txn(nixDB);
|
Transaction txn(nixDB);
|
||||||
|
@ -426,6 +429,9 @@ void addTextToStore(const Path & dstPath, const string & s)
|
||||||
PathLocks outputLock(lockPaths);
|
PathLocks outputLock(lockPaths);
|
||||||
|
|
||||||
if (!isValidPath(dstPath)) {
|
if (!isValidPath(dstPath)) {
|
||||||
|
|
||||||
|
if (pathExists(dstPath)) deletePath(dstPath);
|
||||||
|
|
||||||
writeStringToFile(dstPath, s);
|
writeStringToFile(dstPath, s);
|
||||||
|
|
||||||
Transaction txn(nixDB);
|
Transaction txn(nixDB);
|
||||||
|
|
Loading…
Reference in a new issue