diff --git a/src/vcpkg/build.cpp b/src/vcpkg/build.cpp index b63e4b55ad..1b253dcffc 100644 --- a/src/vcpkg/build.cpp +++ b/src/vcpkg/build.cpp @@ -1080,6 +1080,10 @@ namespace vcpkg::Build size_t port_file_count = 0; for (auto& port_file : fs.get_regular_files_recursive(port_dir, VCPKG_LINE_INFO)) { + if (port_file.filename() == ".DS_Store") + { + continue; + } abi_tag_entries.emplace_back( port_file.filename(), vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, fs, port_file, Hash::Algorithm::Sha256)); diff --git a/src/vcpkg/install.cpp b/src/vcpkg/install.cpp index 18938b1791..592c018458 100644 --- a/src/vcpkg/install.cpp +++ b/src/vcpkg/install.cpp @@ -49,6 +49,7 @@ namespace vcpkg::Install fs.exists(source_dir, IgnoreErrors{}), Strings::concat("Source directory ", source_dir, "does not exist")); auto files = fs.get_files_recursive(source_dir, VCPKG_LINE_INFO); + Util::erase_remove_if(files, [](Path& path) { return path.filename() == ".DS_Store"; }); install_files_and_write_listfile(fs, source_dir, files, destination_dir); } void install_files_and_write_listfile(Filesystem& fs, @@ -177,7 +178,8 @@ namespace vcpkg::Install static SortedVector build_list_of_package_files(const Filesystem& fs, const Path& package_dir) { - const std::vector package_file_paths = fs.get_files_recursive(package_dir, IgnoreErrors{}); + std::vector package_file_paths = fs.get_files_recursive(package_dir, IgnoreErrors{}); + Util::erase_remove_if(package_file_paths, [](Path& path) { return path.filename() == ".DS_Store"; }); const size_t package_remove_char_count = package_dir.native().size() + 1; // +1 for the slash auto package_files = Util::fmap(package_file_paths, [package_remove_char_count](const Path& target) { return std::string(target.generic_u8string(), package_remove_char_count); diff --git a/src/vcpkg/postbuildlint.cpp b/src/vcpkg/postbuildlint.cpp index f9e594ff76..cea6a17611 100644 --- a/src/vcpkg/postbuildlint.cpp +++ b/src/vcpkg/postbuildlint.cpp @@ -959,7 +959,7 @@ namespace vcpkg::PostBuildLint std::vector misplaced_files = fs.get_regular_files_non_recursive(dir, IgnoreErrors{}); Util::erase_remove_if(misplaced_files, [](const Path& target) { const auto filename = target.filename(); - return filename == "CONTROL" || filename == "BUILD_INFO"; + return filename == "CONTROL" || filename == "BUILD_INFO" || filename == ".DS_Store"; }); if (!misplaced_files.empty()) diff --git a/src/vcpkg/vcpkgpaths.cpp b/src/vcpkg/vcpkgpaths.cpp index 7247481a03..80055b4366 100644 --- a/src/vcpkg/vcpkgpaths.cpp +++ b/src/vcpkg/vcpkgpaths.cpp @@ -731,7 +731,10 @@ namespace vcpkg { for (auto&& path : fs.get_regular_files_non_recursive(triplets_dir, VCPKG_LINE_INFO)) { - output.emplace_back(TripletFile(path.stem(), triplets_dir)); + if (Strings::case_insensitive_ascii_equals(path.extension(), ".cmake")) + { + output.emplace_back(TripletFile(path.stem(), triplets_dir)); + } } } @@ -747,6 +750,10 @@ namespace vcpkg auto files = fs.get_regular_files_non_recursive(this->scripts / "cmake", VCPKG_LINE_INFO); for (auto&& file : files) { + if (file.filename() == ".DS_Store") + { + continue; + } helpers.emplace(file.stem().to_string(), Hash::get_file_hash(VCPKG_LINE_INFO, fs, file, Hash::Algorithm::Sha256)); }