mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-15 10:38:48 +08:00
[vcpkg] Handle non-sorted output from std::filesystem
This commit is contained in:
parent
608456b325
commit
7029daa36d
@ -70,8 +70,8 @@ namespace vcpkg::Install
|
|||||||
}
|
}
|
||||||
|
|
||||||
const std::string filename = file.filename().u8string();
|
const std::string filename = file.filename().u8string();
|
||||||
if (fs::is_regular_file(status) && (Strings::case_insensitive_ascii_equals(filename.c_str(), "CONTROL") ||
|
if (fs::is_regular_file(status) && (Strings::case_insensitive_ascii_equals(filename, "CONTROL") ||
|
||||||
Strings::case_insensitive_ascii_equals(filename.c_str(), "BUILD_INFO")))
|
Strings::case_insensitive_ascii_equals(filename, "BUILD_INFO")))
|
||||||
{
|
{
|
||||||
// Do not copy the control file
|
// Do not copy the control file
|
||||||
continue;
|
continue;
|
||||||
|
@ -251,7 +251,9 @@ namespace vcpkg::Paragraphs
|
|||||||
LoadResults try_load_all_ports(const Files::Filesystem& fs, const fs::path& ports_dir)
|
LoadResults try_load_all_ports(const Files::Filesystem& fs, const fs::path& ports_dir)
|
||||||
{
|
{
|
||||||
LoadResults ret;
|
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);
|
auto maybe_spgh = try_load_port(fs, path);
|
||||||
if (const auto spgh = maybe_spgh.get())
|
if (const auto spgh = maybe_spgh.get())
|
||||||
|
@ -54,6 +54,7 @@ namespace vcpkg
|
|||||||
StatusParagraphs current_status_db = load_current_database(fs, status_file, status_file_old);
|
StatusParagraphs current_status_db = load_current_database(fs, status_file, status_file_old);
|
||||||
|
|
||||||
auto update_files = fs.get_files_non_recursive(updates_dir);
|
auto update_files = fs.get_files_non_recursive(updates_dir);
|
||||||
|
Util::sort(update_files);
|
||||||
if (update_files.empty())
|
if (update_files.empty())
|
||||||
{
|
{
|
||||||
// updates directory is empty, control file is up-to-date.
|
// updates directory is empty, control file is up-to-date.
|
||||||
|
@ -405,6 +405,7 @@ namespace vcpkg
|
|||||||
{
|
{
|
||||||
output.push_back(path.stem().filename().string());
|
output.push_back(path.stem().filename().string());
|
||||||
}
|
}
|
||||||
|
Util::sort(output);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user