aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/common-eval-args.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-09-12 15:37:09 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-12-12 14:05:35 +0100
commitae5f62a894190e0075eb60ae4537ba81ca2a0a8d (patch)
treed6b3d856a8c7b6e4e32d54b3f1c3f0cc5b2d2d3c /src/libcmd/common-eval-args.cc
parent7396844676651ea8ee017b9c7578581c5885e0f9 (diff)
Move isUri() and resolveUri() out of filetransfer.cc
These are purely related to NIX_PATH / -I command line parsing, so put them in libexpr.
Diffstat (limited to 'src/libcmd/common-eval-args.cc')
-rw-r--r--src/libcmd/common-eval-args.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcmd/common-eval-args.cc b/src/libcmd/common-eval-args.cc
index dc0de4b9f..782a25964 100644
--- a/src/libcmd/common-eval-args.cc
+++ b/src/libcmd/common-eval-args.cc
@@ -142,10 +142,10 @@ Bindings * MixEvalArgs::getAutoArgs(EvalState & state)
Path lookupFileArg(EvalState & state, std::string_view s)
{
- if (isUri(s)) {
- return state.store->toRealPath(
- fetchers::downloadTarball(
- state.store, resolveUri(s), "source", false).first.storePath);
+ if (EvalSettings::isPseudoUrl(s)) {
+ auto storePath = fetchers::downloadTarball(
+ state.store, EvalSettings::resolvePseudoUrl(s), "source", false).first.storePath;
+ return state.store->toRealPath(storePath);
} else if (s.size() > 2 && s.at(0) == '<' && s.at(s.size() - 1) == '>') {
Path p(s.substr(1, s.size() - 2));
return state.findFile(p);