diff options
Diffstat (limited to 'src/other_tools')
-rw-r--r-- | src/other_tools/repo_map/repos_to_setup_map.cpp | 4 | ||||
-rw-r--r-- | src/other_tools/utils/TARGETS | 5 | ||||
-rw-r--r-- | src/other_tools/utils/parse_archive.cpp | 5 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/other_tools/repo_map/repos_to_setup_map.cpp b/src/other_tools/repo_map/repos_to_setup_map.cpp index 621a593a..6a585d55 100644 --- a/src/other_tools/repo_map/repos_to_setup_map.cpp +++ b/src/other_tools/repo_map/repos_to_setup_map.cpp @@ -104,9 +104,9 @@ void GitCheckout(ExpressionPtr const& repo_desc, ? repo_desc_subdir->String() : "") .lexically_normal(); - if (subdir.is_absolute()) { + if (not PathIsNonUpwards(subdir)) { (*logger)(fmt::format("GitCheckout: Expected field \"subdir\" to be a " - "relative path, but found {}", + "non-upwards path, but found {}", subdir.string()), /*fatal=*/true); return; diff --git a/src/other_tools/utils/TARGETS b/src/other_tools/utils/TARGETS index 4d44c9e5..9eccf244 100644 --- a/src/other_tools/utils/TARGETS +++ b/src/other_tools/utils/TARGETS @@ -63,7 +63,10 @@ , ["src/utils/cpp", "expected"] ] , "private-deps": - [["@", "fmt", "", "fmt"], ["src/buildtool/crypto", "hash_info"]] + [ ["@", "fmt", "", "fmt"] + , ["src/buildtool/crypto", "hash_info"] + , ["src/utils/cpp", "path"] + ] , "stage": ["src", "other_tools", "utils"] } , "parse_git_tree": diff --git a/src/other_tools/utils/parse_archive.cpp b/src/other_tools/utils/parse_archive.cpp index 267d2d2d..72ed5c5d 100644 --- a/src/other_tools/utils/parse_archive.cpp +++ b/src/other_tools/utils/parse_archive.cpp @@ -18,6 +18,7 @@ #include "fmt/core.h" #include "src/buildtool/crypto/hash_info.hpp" +#include "src/utils/cpp/path.hpp" auto ParseArchiveContent(ExpressionPtr const& repo_desc, std::string const& origin) @@ -121,9 +122,9 @@ auto ParseArchiveDescription(ExpressionPtr const& repo_desc, ? repo_desc_subdir->String() : "") .lexically_normal(); - if (subdir.is_absolute()) { + if (not PathIsNonUpwards(subdir)) { (*logger)(fmt::format("ArchiveCheckout: Expected field \"subdir\" to " - "be a relative path, but found {}", + "be a non-upwards path, but found {}", subdir.string()), /*fatal=*/true); return std::nullopt; |