remove_plan now depends on the spec, instead of StatusParagraph
MODIFY
include/vcpkg_Dependencies.h
include/vcpkg_Dependencies.h
@@ -43,7 +43,6 @@ namespace vcpkg::Dependencies
{
remove_plan_type plan_type;
request_type request_type;
- StatusParagraph* status_pgh;
};
struct package_spec_with_remove_plan

MODIFY
src/commands_remove.cpp
src/commands_remove.cpp
@@ -28,8 +28,10 @@ namespace vcpkg::Commands::Remove
}
}
- static void remove_package(const vcpkg_paths& paths, StatusParagraph& pkg)
+ static void remove_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs* status_db)
{
+ StatusParagraph& pkg = **status_db->find(spec.name(), spec.target_triplet());
+
pkg.want = want_t::purge;
pkg.state = install_state_t::half_installed;
write_update(paths, pkg);
@@ -202,7 +204,7 @@ namespace vcpkg::Commands::Remove
{
const std::string display_name = action.spec.display_name();
System::println("Removing package %s... ", display_name);
- remove_package(paths, *action.plan.status_pgh);
+ remove_package(paths, action.spec, &status_db);
System::println(System::color::success, "Removing package %s... done", display_name);
if (alsoRemoveFolderFromPackages)

MODIFY
src/vcpkg_Dependencies.cpp
src/vcpkg_Dependencies.cpp
@@ -93,7 +93,7 @@ namespace vcpkg::Dependencies
const StatusParagraphs::const_iterator it = status_db.find(spec);
if (it == status_db.end() || (*it)->state == install_state_t::not_installed)
{
- was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED, nullptr});
+ was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED});
continue;
}
@@ -115,7 +115,7 @@ namespace vcpkg::Dependencies
}
const request_type request_type = specs_as_set.find(spec) != specs_as_set.end() ? request_type::USER_REQUESTED : request_type::AUTO_SELECTED;
- was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE, request_type,it->get()});
+ was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE});
}
std::vector<package_spec_with_remove_plan> ret;

remove_plan now depends on the spec, instead of StatusParagraph