File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ namespace vcpkg
7878
7979 Path get_triplet_file_path (Triplet triplet) const ;
8080 bool is_valid_triplet_name (StringView name) const ;
81+ bool is_community_triplet_path (const Path& triplet_dir) const ;
82+ bool is_overlay_triplet_path (const Path& triplet_dir) const ;
8183 bool is_valid_triplet_canonical_name (StringView name) const ;
8284 };
8385}
Original file line number Diff line number Diff line change @@ -1063,15 +1063,15 @@ namespace vcpkg
10631063 const auto & triplet_db = paths.get_triplet_db ();
10641064 const auto & triplet_file_path = triplet_db.get_triplet_file_path (triplet);
10651065
1066- if (Strings::starts_with (triplet_file_path, triplet_db.community_triplet_directory ))
1066+ if (triplet_db.is_community_triplet_path (triplet_file_path ))
10671067 {
10681068 msg::print (LocalizedString::from_raw (triplet_file_path)
10691069 .append_raw (" : " )
10701070 .append_raw (InfoPrefix)
10711071 .append (msgLoadedCommunityTriplet)
10721072 .append_raw (' \n ' ));
10731073 }
1074- else if (! Strings::starts_with (triplet_file_path, triplet_db.default_triplet_directory ))
1074+ else if (triplet_db.is_overlay_triplet_path (triplet_file_path ))
10751075 {
10761076 msg::print (LocalizedString::from_raw (triplet_file_path)
10771077 .append_raw (" : " )
Original file line number Diff line number Diff line change @@ -105,6 +105,16 @@ namespace vcpkg
105105 return is_valid_triplet_canonical_name (Strings::ascii_to_lowercase (name));
106106 }
107107
108+ bool TripletDatabase::is_community_triplet_path (const Path& path) const
109+ {
110+ return Strings::starts_with (path, community_triplet_directory);
111+ }
112+
113+ bool TripletDatabase::is_overlay_triplet_path (const Path& path) const
114+ {
115+ return !Strings::starts_with (path, default_triplet_directory) && !is_community_triplet_path (path);
116+ }
117+
108118 bool TripletDatabase::is_valid_triplet_canonical_name (StringView name) const
109119 {
110120 return Util::any_of (available_triplets, [=](const TripletFile& tf) { return tf.name == name; });
You can’t perform that action at this time.
0 commit comments