summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-07 23:27:40 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-07 23:27:40 +0000
commit6833e8bbe89dc61bda59a1e04c01415501ad4133 (patch)
treea053486be8689a83792478580396f012347acb4f /src/libstore
parente24d0201c29b09483944b462bd62b71a90c99c97 (diff)
downloadguix-6833e8bbe89dc61bda59a1e04c01415501ad4133.tar.gz
* When keeping the temporary build directory (-K), change the owner
  back to the Nix account.

Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 0d2879cc94..9f3420c684 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1698,10 +1698,13 @@ void DerivationGoal::initChild()
 void DerivationGoal::deleteTmpDir(bool force)
 {
     if (tmpDir != "") {
-        if (keepFailed && !force)
+        if (keepFailed && !force) {
 	    printMsg(lvlError, 
 		format("builder for `%1%' failed; keeping build directory `%2%'")
                 % drvPath % tmpDir);
+            if (buildUser.enabled() && !amPrivileged())
+                getOwnership(tmpDir);
+        }
         else
             deletePathWrapped(tmpDir);
         tmpDir = "";