diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-01-12 17:31:08 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-01-12 17:31:08 +0100 |
commit | 74f75c855837bce7f48491e9ce8ac03794e5b40d (patch) | |
tree | edf3ff8bfd9ebd4bf038a78dc7991ebe3f1b28e2 /src/libstore/store-api.hh | |
parent | 435ccc798077e6291fd34fd1720c6abcf3521557 (diff) |
import, builtins.readFile: Handle diverted stores
Fixes #1791
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r-- | src/libstore/store-api.hh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index d1e1b5d6f..c0e735cd3 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -597,6 +597,11 @@ public: "nix-cache-info" file. Lower value means higher priority. */ virtual int getPriority() { return 0; } + virtual Path toRealPath(const Path & storePath) + { + return storePath; + } + protected: Stats stats; @@ -639,9 +644,10 @@ public: virtual Path getRealStoreDir() { return storeDir; } - Path toRealPath(const Path & storePath) + Path toRealPath(const Path & storePath) override { - return getRealStoreDir() + "/" + baseNameOf(storePath); + assert(isInStore(storePath)); + return getRealStoreDir() + "/" + std::string(storePath, storeDir.size() + 1); } std::shared_ptr<std::string> getBuildLog(const Path & path) override; |