add needs_rebuild, should probably be moved to somewhere else
MODIFY
include/vcpkg/statusparagraphs.h
include/vcpkg/statusparagraphs.h
@@ -62,6 +62,8 @@ namespace vcpkg
/// <returns>`true` if installed, `false` if not or not found.</returns>
bool is_installed(const FeatureSpec& spec) const;
+ bool needs_rebuild(const PackageSpec& spec);
+
iterator insert(std::unique_ptr<StatusParagraph>);
friend void serialize(const StatusParagraphs& pgh, std::string& out_str);

MODIFY
src/vcpkg/statusparagraphs.cpp
src/vcpkg/statusparagraphs.cpp
@@ -118,6 +118,31 @@ namespace vcpkg
return it != end() && (*it)->is_installed();
}
+ bool vcpkg::StatusParagraphs::needs_rebuild(const PackageSpec& spec)
+ {
+ auto it = find(spec);
+ if (it != end())
+ {
+ for (const std::string& dep : (*it)->package.depends)
+ {
+ PackageSpec dep_spec =
+ PackageSpec::from_name_and_triplet(
+ dep,
+ spec.triplet()).value_or_exit(VCPKG_LINE_INFO);
+
+ if (needs_rebuild(dep_spec))
+ {
+ (*it)->state = InstallState::NEEDS_REBUILD;
+ return true;
+ }
+ }
+
+ return (*it)->needs_rebuild();
+ }
+
+ return false;
+ }
+
StatusParagraphs::iterator StatusParagraphs::insert(std::unique_ptr<StatusParagraph> pgh)
{
Checks::check_exit(VCPKG_LINE_INFO, pgh != nullptr, "Inserted null paragraph");

add needs_rebuild, should probably be moved to somewhere else