aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-07-17 13:13:18 +0200
committerEelco Dolstra <edolstra@gmail.com>2017-07-17 13:13:18 +0200
commitbf6792c0df2163a0501beb14feeb5135c4aa71c2 (patch)
tree2e10250c084d65ec8d5da88a6381ee95e24c22bb /src/libstore
parent49304bae812f2c5334f304a4ea6a4e06360b33da (diff)
Always use base-16 for hashed mirror lookups
In particular, don't use base-64, which we don't support. (We do have base-32 redirects for hysterical reasons.) Also, add a test for the hashed mirror feature.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/builtins.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/builtins.cc b/src/libstore/builtins.cc
index b51b6f85c..a01dbba4e 100644
--- a/src/libstore/builtins.cc
+++ b/src/libstore/builtins.cc
@@ -42,7 +42,8 @@ void builtinFetchurl(const BasicDerivation & drv, const std::string & netrcData)
for (auto hashedMirror : settings.hashedMirrors.get())
try {
if (!hasSuffix(hashedMirror, "/")) hashedMirror += '/';
- data = fetch(hashedMirror + getAttr("outputHashAlgo") + "/" + getAttr("outputHash"));
+ auto ht = parseHashType(getAttr("outputHashAlgo"));
+ data = fetch(hashedMirror + printHashType(ht) + "/" + Hash(getAttr("outputHash"), ht).to_string(Base16, false));
break;
} catch (Error & e) {
debug(e.what());