aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/tarball.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-01-02 20:53:39 +0100
committerEelco Dolstra <edolstra@gmail.com>2023-01-02 20:53:39 +0100
commit6b6965238506705382892b14ef22700fc5112c3d (patch)
treec5a0f04bee2bace1281d7c7b405c8214641072c8 /src/libfetchers/tarball.cc
parente0ab2069c975abf80db9fdca23f0c164df921829 (diff)
parent9af16c5f742300e831a2cc400e43df1e22f87f31 (diff)
Merge remote-tracking branch 'origin/master' into coerce-string
Diffstat (limited to 'src/libfetchers/tarball.cc')
-rw-r--r--src/libfetchers/tarball.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc
index 6c551bd93..e9686262a 100644
--- a/src/libfetchers/tarball.cc
+++ b/src/libfetchers/tarball.cc
@@ -185,7 +185,7 @@ struct CurlInputScheme : InputScheme
virtual bool isValidURL(const ParsedURL & url) const = 0;
- std::optional<Input> inputFromURL(const ParsedURL & url) override
+ std::optional<Input> inputFromURL(const ParsedURL & url) const override
{
if (!isValidURL(url))
return std::nullopt;
@@ -203,7 +203,7 @@ struct CurlInputScheme : InputScheme
return input;
}
- std::optional<Input> inputFromAttrs(const Attrs & attrs) override
+ std::optional<Input> inputFromAttrs(const Attrs & attrs) const override
{
auto type = maybeGetStrAttr(attrs, "type");
if (type != inputType()) return {};
@@ -220,16 +220,17 @@ struct CurlInputScheme : InputScheme
return input;
}
- ParsedURL toURL(const Input & input) override
+ ParsedURL toURL(const Input & input) const override
{
auto url = parseURL(getStrAttr(input.attrs, "url"));
- // NAR hashes are preferred over file hashes since tar/zip files // don't have a canonical representation.
+ // NAR hashes are preferred over file hashes since tar/zip
+ // files don't have a canonical representation.
if (auto narHash = input.getNarHash())
url.query.insert_or_assign("narHash", narHash->to_string(SRI, true));
return url;
}
- bool hasAllInfo(const Input & input) override
+ bool hasAllInfo(const Input & input) const override
{
return true;
}