* Remove obstructing invalid store paths add[Text]ToStore().

This commit is contained in:
Eelco Dolstra 2004-06-21 07:46:02 +00:00
parent daf0a923c7
commit be1a917beb
1 changed files with 6 additions and 0 deletions

View File

@ -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);