1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 22:01:15 +02:00

import, builtins.readFile: Handle diverted stores

Fixes #1791
This commit is contained in:
Eelco Dolstra 2018-01-12 17:31:08 +01:00
parent 435ccc7980
commit 74f75c8558
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 33 additions and 8 deletions

View file

@ -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;