about summary refs log tree commit diff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-09T00·26+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-09T00·26+0000
commit5f681988f210dd8edbb0d13da7d00e1c0e2a1769 (patch)
treeb6668269225fd8098c26463307c5dea096339f0d /src/libstore/local-store.cc
parentfa333031464ca394317a55a0e7c6b773f068aae2 (diff)
* Use deletePathWrapped() in more places.
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 2378002097..4144f0831b 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -637,7 +637,7 @@ Path LocalStore::addToStore(const Path & _srcPath, bool fixed,
 
         if (!isValidPath(dstPath)) {
 
-            if (pathExists(dstPath)) deletePath(dstPath);
+            if (pathExists(dstPath)) deletePathWrapped(dstPath);
 
             copyPath(srcPath, dstPath);
 
@@ -673,7 +673,7 @@ Path LocalStore::addTextToStore(const string & suffix, const string & s,
 
         if (!isValidPath(dstPath)) {
 
-            if (pathExists(dstPath)) deletePath(dstPath);
+            if (pathExists(dstPath)) deletePathWrapped(dstPath);
 
             writeStringToFile(dstPath, s);
 
@@ -710,18 +710,7 @@ void deleteFromStore(const Path & _path, unsigned long long & bytesFreed)
     }
     txn.commit();
 
-    try {
-        /* First try to delete it ourselves. */
-        deletePath(path, bytesFreed);
-    } catch (SysError & e) {
-        /* If this failed due to a permission error, then try it with
-           the setuid helper. */
-        if (haveBuildUsers() && !amPrivileged()) {
-            getOwnership(path);
-            deletePath(path, bytesFreed);
-        } else
-            throw;
-    }
+    deletePathWrapped(path, bytesFreed);
 }