aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops/fetchTree.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-09-15 18:37:58 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-09-15 18:37:58 +0200
commitc17f3c5e699a8332acc536b985dcd710f3ce0a23 (patch)
tree909be3ae3d73960a6553038d0f548b141d855899 /src/libexpr/primops/fetchTree.cc
parentd2c8eed34496b650935e4563ffe3174978bd22fc (diff)
parentd56ddbb99965dc46cb80b05857588624c249aba6 (diff)
Merge branch 'mh/fix-chroot-eval' of https://github.com/obsidiansystems/nix
Diffstat (limited to 'src/libexpr/primops/fetchTree.cc')
-rw-r--r--src/libexpr/primops/fetchTree.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc
index 9990a0207..9c791db31 100644
--- a/src/libexpr/primops/fetchTree.cc
+++ b/src/libexpr/primops/fetchTree.cc
@@ -229,20 +229,21 @@ static void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v,
? fetchers::downloadTarball(state.store, *url, name, (bool) expectedHash).first.storePath
: fetchers::downloadFile(state.store, *url, name, (bool) expectedHash).storePath;
- auto path = state.store->toRealPath(storePath);
+ auto realPath = state.store->toRealPath(storePath);
if (expectedHash) {
auto hash = unpack
? state.store->queryPathInfo(storePath)->narHash
- : hashFile(htSHA256, path);
+ : hashFile(htSHA256, realPath);
if (hash != *expectedHash)
throw Error((unsigned int) 102, "hash mismatch in file downloaded from '%s':\n specified: %s\n got: %s",
*url, expectedHash->to_string(Base32, true), hash.to_string(Base32, true));
}
if (state.allowedPaths)
- state.allowedPaths->insert(path);
+ state.allowedPaths->insert(realPath);
+ auto path = state.store->printStorePath(storePath);
mkString(v, path, PathSet({path}));
}