summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/other_tools/repo_map/repos_to_setup_map.cpp4
-rw-r--r--src/other_tools/utils/TARGETS1
-rw-r--r--src/other_tools/utils/parse_archive.cpp5
3 files changed, 6 insertions, 4 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 27c39a77..383f763d 100644
--- a/src/other_tools/repo_map/repos_to_setup_map.cpp
+++ b/src/other_tools/repo_map/repos_to_setup_map.cpp
@@ -112,9 +112,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 550de9f5..24d6c5ac 100644
--- a/src/other_tools/utils/TARGETS
+++ b/src/other_tools/utils/TARGETS
@@ -73,6 +73,7 @@
, ["src/buildtool/crypto", "hash_function"]
, ["src/buildtool/crypto", "hash_info"]
, ["src/buildtool/file_system/symlinks_map", "pragma_special"]
+ , ["src/utils/cpp", "path"]
]
, "stage": ["src", "other_tools", "utils"]
}
diff --git a/src/other_tools/utils/parse_archive.cpp b/src/other_tools/utils/parse_archive.cpp
index 50b9d4a3..e31109a9 100644
--- a/src/other_tools/utils/parse_archive.cpp
+++ b/src/other_tools/utils/parse_archive.cpp
@@ -26,6 +26,7 @@
#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/crypto/hash_info.hpp"
#include "src/buildtool/file_system/symlinks_map/pragma_special.hpp"
+#include "src/utils/cpp/path.hpp"
auto ParseArchiveContent(ExpressionPtr const& repo_desc,
std::string const& origin)
@@ -129,9 +130,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;