aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorBilly O'Neal <bion@microsoft.com>2020-05-19 13:43:30 -0700
committerGitHub <noreply@github.com>2020-05-19 13:43:30 -0700
commit3b0080e3b0d395de7551cc2ce1ec89189e539eab (patch)
treed0a6877c62dc90eab4a7ac1d7b9530985522cca9 /toolsrc/include
parente806b2ed384fce2487562371fb32d9528d0c178a (diff)
downloadvcpkg-3b0080e3b0d395de7551cc2ce1ec89189e539eab.tar.gz
vcpkg-3b0080e3b0d395de7551cc2ce1ec89189e539eab.zip
[vcpkg] Harden file removals and clean directory contents in "CI" inside vcpkg itself. (#11432)
`files.h/files.cpp`: * Add end and else comments to all macros. * Add "remove_all_inside" function which empties a directory without actually deleting the directory. This is necessary to handle the case where the directory is actually a directory symlink. * Change remove_all to use std::remove when VCPKG_USE_STD_FILESYSTEM is set; this will engage POSIX delete support available on current Win10. `commands.ci.cpp`: empty "installed". `*/initialize_environment.*`: No longer clean the directories outside the tool. `ci-step.ps1`: Remove unused console output tee-ing.
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg/base/files.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h
index 8f278cd20..0fba3a55f 100644
--- a/toolsrc/include/vcpkg/base/files.h
+++ b/toolsrc/include/vcpkg/base/files.h
@@ -134,6 +134,9 @@ namespace vcpkg::Files
virtual void remove_all(const fs::path& path, std::error_code& ec, fs::path& failure_point) = 0;
void remove_all(const fs::path& path, LineInfo li);
void remove_all(const fs::path& path, ignore_errors_t);
+ virtual void remove_all_inside(const fs::path& path, std::error_code& ec, fs::path& failure_point) = 0;
+ void remove_all_inside(const fs::path& path, LineInfo li);
+ void remove_all_inside(const fs::path& path, ignore_errors_t);
bool exists(const fs::path& path, std::error_code& ec) const;
bool exists(LineInfo li, const fs::path& path) const;
bool exists(const fs::path& path, ignore_errors_t = ignore_errors) const;