diff --git a/src/libflake/flake/flakeref.cc b/src/libflake/flake/flakeref.cc index 3a43a51f8..06198b10c 100644 --- a/src/libflake/flake/flakeref.cc +++ b/src/libflake/flake/flakeref.cc @@ -49,9 +49,9 @@ FlakeRef parseFlakeRef( const std::optional & baseDir, bool allowMissing, bool isFlake, - bool allowRelative) + bool preserveRelativePaths) { - auto [flakeRef, fragment] = parseFlakeRefWithFragment(fetchSettings, url, baseDir, allowMissing, isFlake, allowRelative); + auto [flakeRef, fragment] = parseFlakeRefWithFragment(fetchSettings, url, baseDir, allowMissing, isFlake, preserveRelativePaths); if (fragment != "") throw Error("unexpected fragment '%s' in flake reference '%s'", fragment, url); return flakeRef; @@ -89,7 +89,7 @@ std::pair parsePathFlakeRefWithFragment( const std::optional & baseDir, bool allowMissing, bool isFlake, - bool allowRelative) + bool preserveRelativePaths) { std::string path = url; std::string fragment = ""; @@ -191,7 +191,7 @@ std::pair parsePathFlakeRefWithFragment( } } else { - if (!allowRelative && !hasPrefix(path, "/")) + if (!preserveRelativePaths && !hasPrefix(path, "/")) throw BadURL("flake reference '%s' is not an absolute path", url); } @@ -258,7 +258,7 @@ std::pair parseFlakeRefWithFragment( const std::optional & baseDir, bool allowMissing, bool isFlake, - bool allowRelative) + bool preserveRelativePaths) { using namespace fetchers; @@ -267,7 +267,7 @@ std::pair parseFlakeRefWithFragment( } else if (auto res = parseURLFlakeRef(fetchSettings, url, baseDir, isFlake)) { return *res; } else { - return parsePathFlakeRefWithFragment(fetchSettings, url, baseDir, allowMissing, isFlake, allowRelative); + return parsePathFlakeRefWithFragment(fetchSettings, url, baseDir, allowMissing, isFlake, preserveRelativePaths); } } diff --git a/src/libflake/flake/flakeref.hh b/src/libflake/flake/flakeref.hh index 32094d381..c9cf7952d 100644 --- a/src/libflake/flake/flakeref.hh +++ b/src/libflake/flake/flakeref.hh @@ -85,7 +85,7 @@ FlakeRef parseFlakeRef( const std::optional & baseDir = {}, bool allowMissing = false, bool isFlake = true, - bool allowRelative = false); + bool preserveRelativePaths = false); /** * @param baseDir Optional [base directory](https://nixos.org/manual/nix/unstable/glossary#gloss-base-directory) @@ -104,7 +104,7 @@ std::pair parseFlakeRefWithFragment( const std::optional & baseDir = {}, bool allowMissing = false, bool isFlake = true, - bool allowRelative = false); + bool preserveRelativePaths = false); /** * @param baseDir Optional [base directory](https://nixos.org/manual/nix/unstable/glossary#gloss-base-directory)