diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-06-21T07·46+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-06-21T07·46+0000 |
commit | be1a917beb4577dd359a5e8ea17ca69dd228e6ae (patch) | |
tree | 10234097c250fd05c61eb81b59a192a46c24a168 /src/libstore/store.cc | |
parent | daf0a923c7c77300dfb09ee34c1ae31c87002a0e (diff) |
* Remove obstructing invalid store paths add[Text]ToStore().
Diffstat (limited to 'src/libstore/store.cc')
-rw-r--r-- | src/libstore/store.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstore/store.cc b/src/libstore/store.cc index 9c5d0bab8aae..73c09b27442f 100644 --- a/src/libstore/store.cc +++ b/src/libstore/store.cc @@ -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); |