aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-07-08 22:07:10 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-07-08 22:07:21 +0200
commitb981e5aacf3848424264f4a84826f8f9ca33da14 (patch)
tree9eef91a44cf9ecac32de44284a0d8233fb7b6e88
parent34f25124ba2ab32b8a95d6b37cd68d7bb85ff2d4 (diff)
Cleanup
-rw-r--r--src/libstore/local-store.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index b9176ec38..fa66c1c90 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -976,7 +976,7 @@ void LocalStore::addToStore(const ValidPathInfo & info, Source & source,
PathLocks outputLock;
- Path realPath = realStoreDir + "/" + std::string(info.path.to_string());
+ auto realPath = Store::toRealPath(info.path);
/* Lock the output path. But don't lock if we're being called
from a build hook (whose parent process already acquired a
@@ -1047,8 +1047,7 @@ StorePath LocalStore::addToStoreFromDump(const string & dump, const string & nam
/* The first check above is an optimisation to prevent
unnecessary lock acquisition. */
- Path realPath = realStoreDir + "/";
- realPath += dstPath.to_string();
+ auto realPath = Store::toRealPath(dstPath);
PathLocks outputLock({realPath});
@@ -1167,7 +1166,7 @@ StorePath LocalStore::addToStore(const string & name, const Path & _srcPath,
Hash hash = hashSink ? hashSink->finish().first : sha256.first;
- Path dstPath = makeFixedOutputPath(method, hash, name);
+ auto dstPath = makeFixedOutputPath(method, hash, name);
addTempRoot(dstPath);
@@ -1176,7 +1175,7 @@ StorePath LocalStore::addToStore(const string & name, const Path & _srcPath,
/* The first check above is an optimisation to prevent
unnecessary lock acquisition. */
- Path realPath = realStoreDir + "/" + baseNameOf(dstPath);
+ auto realPath = Store::toRealPath(dstPath);
PathLocks outputLock({realPath});
@@ -1224,8 +1223,7 @@ StorePath LocalStore::addTextToStore(const string & name, const string & s,
if (repair || !isValidPath(dstPath)) {
- Path realPath = realStoreDir + "/";
- realPath += dstPath.to_string();
+ auto realPath = Store::toRealPath(dstPath);
PathLocks outputLock({realPath});