aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/fetchers.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-08-01 16:07:20 +0200
committerEelco Dolstra <edolstra@gmail.com>2023-08-01 16:07:20 +0200
commitd9e7758f4756c10592407b3fe99dc253ef56eac9 (patch)
tree960315c30ed9cbc7dd182c391aba64f212dba183 /src/libfetchers/fetchers.hh
parentdcdd5fed74445c526a361202a9e6c8459a38726b (diff)
Don't require .tar/.zip extension for tarball flakerefs
Special-casing the file name is rather ugly, so we shouldn't do that. So now any {file,http,https} URL is handled by TarballInputScheme, except for non-flake inputs (i.e. inputs that have the attribute `flake = false`).
Diffstat (limited to 'src/libfetchers/fetchers.hh')
-rw-r--r--src/libfetchers/fetchers.hh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libfetchers/fetchers.hh b/src/libfetchers/fetchers.hh
index d0738f619..6e10e9513 100644
--- a/src/libfetchers/fetchers.hh
+++ b/src/libfetchers/fetchers.hh
@@ -44,9 +44,9 @@ struct Input
std::optional<Path> parent;
public:
- static Input fromURL(const std::string & url);
+ static Input fromURL(const std::string & url, bool requireTree = true);
- static Input fromURL(const ParsedURL & url);
+ static Input fromURL(const ParsedURL & url, bool requireTree = true);
static Input fromAttrs(Attrs && attrs);
@@ -129,7 +129,7 @@ struct InputScheme
virtual ~InputScheme()
{ }
- virtual std::optional<Input> inputFromURL(const ParsedURL & url) const = 0;
+ virtual std::optional<Input> inputFromURL(const ParsedURL & url, bool requireTree) const = 0;
virtual std::optional<Input> inputFromAttrs(const Attrs & attrs) const = 0;