mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
Move isUri() and resolveUri() out of filetransfer.cc
These are purely related to NIX_PATH / -I command line parsing, so put them in libexpr.
This commit is contained in:
parent
7396844676
commit
ae5f62a894
7 changed files with 30 additions and 33 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue