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);
|
auto res = inputScheme->inputFromAttrs(attrs2);
|
||||||
if (res) {
|
if (res) {
|
||||||
if (auto narHash = maybeGetStrAttr(attrs, "narHash"))
|
if (auto narHash = maybeGetStrAttr(attrs, "narHash"))
|
||||||
// FIXME: require SRI hash.
|
res->narHash = Hash::fromSRI(*narHash);
|
||||||
res->narHash = newHashAllowEmpty(*narHash, {});
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,15 +242,13 @@ struct TarballInputScheme : InputScheme
|
||||||
|
|
||||||
auto hash = input->url.query.find("hash");
|
auto hash = input->url.query.find("hash");
|
||||||
if (hash != input->url.query.end()) {
|
if (hash != input->url.query.end()) {
|
||||||
// FIXME: require SRI hash.
|
input->hash = Hash::fromSRI(hash->second);
|
||||||
input->hash = Hash(hash->second);
|
|
||||||
input->url.query.erase(hash);
|
input->url.query.erase(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto narHash = input->url.query.find("narHash");
|
auto narHash = input->url.query.find("narHash");
|
||||||
if (narHash != input->url.query.end()) {
|
if (narHash != input->url.query.end()) {
|
||||||
// FIXME: require SRI hash.
|
input->narHash = Hash::fromSRI(narHash->second);
|
||||||
input->narHash = Hash(narHash->second);
|
|
||||||
input->url.query.erase(narHash);
|
input->url.query.erase(narHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ struct Hash
|
||||||
// hash type must be part of string
|
// hash type must be part of string
|
||||||
Hash(std::string_view s);
|
Hash(std::string_view s);
|
||||||
|
|
||||||
Hash fromSRI(std::string_view original);
|
static Hash fromSRI(std::string_view original);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// type must be provided, s must not include <type> prefix
|
// type must be provided, s must not include <type> prefix
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "lazy.hh"
|
#include "lazy.hh"
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
|
#include "hash.hh"
|
||||||
#include "affinity.hh"
|
#include "affinity.hh"
|
||||||
#include "sync.hh"
|
#include "sync.hh"
|
||||||
#include "finally.hh"
|
#include "finally.hh"
|
||||||
|
|
Loading…
Reference in a new issue