forked from lix-project/lix
Correct FIXMEs in libfetchers
This commit is contained in:
parent
c2e7f7a712
commit
274a8136fb
|
@ -35,8 +35,7 @@ std::unique_ptr<Input> inputFromAttrs(const Attrs & attrs)
|
|||
auto res = inputScheme->inputFromAttrs(attrs2);
|
||||
if (res) {
|
||||
if (auto narHash = maybeGetStrAttr(attrs, "narHash"))
|
||||
// FIXME: require SRI hash.
|
||||
res->narHash = newHashAllowEmpty(*narHash, {});
|
||||
res->narHash = Hash::fromSRI(*narHash);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,15 +242,13 @@ struct TarballInputScheme : InputScheme
|
|||
|
||||
auto hash = input->url.query.find("hash");
|
||||
if (hash != input->url.query.end()) {
|
||||
// FIXME: require SRI hash.
|
||||
input->hash = Hash(hash->second);
|
||||
input->hash = Hash::fromSRI(hash->second);
|
||||
input->url.query.erase(hash);
|
||||
}
|
||||
|
||||
auto narHash = input->url.query.find("narHash");
|
||||
if (narHash != input->url.query.end()) {
|
||||
// FIXME: require SRI hash.
|
||||
input->narHash = Hash(narHash->second);
|
||||
input->narHash = Hash::fromSRI(narHash->second);
|
||||
input->url.query.erase(narHash);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ struct Hash
|
|||
// hash type must be part of string
|
||||
Hash(std::string_view s);
|
||||
|
||||
Hash fromSRI(std::string_view original);
|
||||
static Hash fromSRI(std::string_view original);
|
||||
|
||||
private:
|
||||
// type must be provided, s must not include <type> prefix
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "lazy.hh"
|
||||
#include "util.hh"
|
||||
#include "hash.hh"
|
||||
#include "affinity.hh"
|
||||
#include "sync.hh"
|
||||
#include "finally.hh"
|
||||
|
|
Loading…
Reference in a new issue