[vcpkg] Handle non-sorted output from std::filesystem
MODIFY
src/vcpkg/install.cpp
src/vcpkg/install.cpp
@@ -70,8 +70,8 @@ namespace vcpkg::Install
}
const std::string filename = file.filename().u8string();
- if (fs::is_regular_file(status) && (Strings::case_insensitive_ascii_equals(filename.c_str(), "CONTROL") ||
- Strings::case_insensitive_ascii_equals(filename.c_str(), "BUILD_INFO")))
+ if (fs::is_regular_file(status) && (Strings::case_insensitive_ascii_equals(filename, "CONTROL") ||
+ Strings::case_insensitive_ascii_equals(filename, "BUILD_INFO")))
{
// Do not copy the control file
continue;

MODIFY
src/vcpkg/paragraphs.cpp
src/vcpkg/paragraphs.cpp
@@ -251,7 +251,9 @@ namespace vcpkg::Paragraphs
LoadResults try_load_all_ports(const Files::Filesystem& fs, const fs::path& ports_dir)
{
LoadResults ret;
- for (auto&& path : fs.get_files_non_recursive(ports_dir))
+ auto port_dirs = fs.get_files_non_recursive(ports_dir);
+ Util::sort(port_dirs);
+ for (auto&& path : port_dirs)
{
auto maybe_spgh = try_load_port(fs, path);
if (const auto spgh = maybe_spgh.get())

MODIFY
src/vcpkg/vcpkglib.cpp
src/vcpkg/vcpkglib.cpp
@@ -54,6 +54,7 @@ namespace vcpkg
StatusParagraphs current_status_db = load_current_database(fs, status_file, status_file_old);
auto update_files = fs.get_files_non_recursive(updates_dir);
+ Util::sort(update_files);
if (update_files.empty())
{
// updates directory is empty, control file is up-to-date.

MODIFY
src/vcpkg/vcpkgpaths.cpp
src/vcpkg/vcpkgpaths.cpp
@@ -405,6 +405,7 @@ namespace vcpkg
{
output.push_back(path.stem().filename().string());
}
+ Util::sort(output);
return output;
});

[vcpkg] Handle non-sorted output from std::filesystem