about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-13T15·44+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-13T15·44+0200
commit9367046feff702af2dc5b1c5f45254b970d4da91 (patch)
tree9353d265e2571fb7658e0746b5e573a4d87d8787 /src
parent5f05197df460bafd9a4f451d69757401b35a1180 (diff)
Use regular file GC roots if possible
This makes hydra-eval-jobs create roots as regular files. See
1c208f2b7ef8ffb5e6d435d703dad83223a67bd6.
Diffstat (limited to 'src')
-rw-r--r--src/libstore/gc.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index e5836150c7b3..74c2083904be 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -115,7 +115,10 @@ Path addPermRoot(StoreAPI & store, const Path & _storePath,
                     % gcRoot % rootsDir);
         }
 
-        makeSymlink(gcRoot, storePath);
+        if (baseNameOf(gcRoot) == baseNameOf(storePath))
+            writeFile(gcRoot, "");
+        else
+            makeSymlink(gcRoot, storePath);
     }
 
     /* Check that the root can be found by the garbage collector.