[vcpkg] Handle missing fields in print_error_message()
MODIFY
src/SourceParagraph.cpp
src/SourceParagraph.cpp
@@ -56,7 +56,7 @@ namespace vcpkg
System::println(System::Color::error,
"Error: There are invalid fields in the Source Paragraph of %s",
error_info->name);
- System::println("The following fields were not expected:\n\n %s\n\n",
+ System::println("The following fields were not expected:\n\n %s\n",
Strings::join("\n ", error_info->extra_fields));
have_remaining_fields = true;
}
@@ -68,6 +68,18 @@ namespace vcpkg
Strings::join("\n ", get_list_of_valid_fields()));
System::println("Different source may be available for vcpkg. Use .\\bootstrap-vcpkg.bat to update.\n");
}
+
+ for (auto&& error_info : error_info_list)
+ {
+ if (!error_info->missing_fields.empty())
+ {
+ System::println(System::Color::error,
+ "Error: There are missing fields in the Source Paragraphs of %s",
+ error_info->name);
+ System::println("The following fields were missing:\n\n %s\n",
+ Strings::join("\n ", error_info->missing_fields));
+ }
+ }
}
static ParseExpected<SourceParagraph> parse_source_paragraph(RawParagraph&& fields)

[vcpkg] Handle missing fields in print_error_message()