about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-06-21T07·46+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-06-21T07·46+0000
commitbe1a917beb4577dd359a5e8ea17ca69dd228e6ae (patch)
tree10234097c250fd05c61eb81b59a192a46c24a168 /src
parentdaf0a923c7c77300dfb09ee34c1ae31c87002a0e (diff)
* Remove obstructing invalid store paths add[Text]ToStore().
Diffstat (limited to 'src')
-rw-r--r--src/libstore/store.cc6
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);