aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/optimise-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-01-03 12:59:23 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-01-03 12:59:23 +0100
commitdef5160b614a59a0aa96fe2252e3daa00146e061 (patch)
tree3ec0b2ade78dfbf00399246fea86d3706ce0db93 /src/libstore/optimise-store.cc
parent0a4e90395c3286a246b816575351b9f2016976ba (diff)
Clear any immutable bits in the Nix store
Doing this once makes subsequent operations like garbage collecting more efficient since we don't have to call makeMutable() first.
Diffstat (limited to 'src/libstore/optimise-store.cc')
-rw-r--r--src/libstore/optimise-store.cc9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc
index 43b3c9b4f..e91c2b1ce 100644
--- a/src/libstore/optimise-store.cc
+++ b/src/libstore/optimise-store.cc
@@ -2,7 +2,6 @@
#include "util.hh"
#include "local-store.hh"
-#include "immutable.hh"
#include "globals.hh"
#include <sys/types.h>
@@ -20,7 +19,6 @@ static void makeWritable(const Path & path)
struct stat st;
if (lstat(path.c_str(), &st))
throw SysError(format("getting attributes of path `%1%'") % path);
- if (S_ISDIR(st.st_mode) || S_ISREG(st.st_mode)) makeMutable(path);
if (chmod(path.c_str(), st.st_mode | S_IWUSR) == -1)
throw SysError(format("changing writability of `%1%'") % path);
}
@@ -91,7 +89,6 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path)
if (!pathExists(linkPath)) {
/* Nope, create a hard link in the links directory. */
- makeMutable(path);
if (link(path.c_str(), linkPath.c_str()) == 0) return;
if (errno != EEXIST)
throw SysError(format("cannot link `%1%' to `%2%'") % linkPath % path);
@@ -123,12 +120,6 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path)
its timestamp back to 0. */
MakeReadOnly makeReadOnly(mustToggle ? dirOf(path) : "");
- /* If ‘linkPath’ is immutable, we can't create hard links to it,
- so make it mutable first. We also have to make ‘path’ mutable,
- otherwise rename() will fail to delete it. */
- makeMutable(path);
- makeMutable(linkPath);
-
Path tempLink = (format("%1%/.tmp-link-%2%-%3%")
% settings.nixStore % getpid() % rand()).str();