From d974d2ad59d1cc8aee63e2a18124e58c1084ff65 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Mar 2022 11:29:19 +0100 Subject: [PATCH] fetch{url,Tarball}: Remove 'narHash' attribute This was introduced in #6174. However fetch{url,Tarball} are legacy and we shouldn't have an undocumented attribute that does the same thing as one that already exists ('sha256'). --- src/libexpr/eval.cc | 2 +- src/libexpr/eval.hh | 2 +- src/libexpr/primops/fetchTree.cc | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index d94afbb99..8c5888497 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -517,7 +517,7 @@ void EvalState::allowPath(const StorePath & storePath) allowedPaths->insert(store->toRealPath(storePath)); } -void EvalState::allowAndSetStorePathString(const StorePath &storePath, Value &v) +void EvalState::allowAndSetStorePathString(const StorePath &storePath, Value & v) { allowPath(storePath); diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 9324961f7..36a53729a 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -162,7 +162,7 @@ public: void allowPath(const StorePath & storePath); /* Allow access to a store path and return it as a string. */ - void allowAndSetStorePathString(const StorePath & storePath, Value &v); + void allowAndSetStorePathString(const StorePath & storePath, Value & v); /* Check whether access to a path is allowed and throw an error if not. Otherwise return the canonicalised path. */ diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc index 2eeee7173..cb929b99a 100644 --- a/src/libexpr/primops/fetchTree.cc +++ b/src/libexpr/primops/fetchTree.cc @@ -203,8 +203,6 @@ static void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v, url = state.forceStringNoCtx(*attr.value, *attr.pos); else if (n == "sha256") expectedHash = newHashAllowEmpty(state.forceStringNoCtx(*attr.value, *attr.pos), htSHA256); - else if (n == "narHash") - expectedHash = newHashAllowEmpty(state.forceStringNoCtx(*attr.value, *attr.pos), htSHA256); else if (n == "name") name = state.forceStringNoCtx(*attr.value, *attr.pos); else