aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-01-23 14:14:01 -0800
committerRobert Schumacher <roschuma@microsoft.com>2018-01-23 14:14:01 -0800
commit130fa279f968ad9661ff4614a2b87f1bb0c5aee2 (patch)
treede9873942077203dd35462b4e6d96636c4c366bd /toolsrc/src
parent91f447631da356ca9e8f1eca92f5f59a57e3b5fb (diff)
downloadvcpkg-130fa279f968ad9661ff4614a2b87f1bb0c5aee2.tar.gz
vcpkg-130fa279f968ad9661ff4614a2b87f1bb0c5aee2.zip
[vcpkg] Revert making remove_package() take status_db by const
The in-memory database must be updated to communicate to future actions that they need to look at this package's files (or not)
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg/install.cpp2
-rw-r--r--toolsrc/src/vcpkg/remove.cpp10
2 files changed, 7 insertions, 5 deletions
diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp
index 7a1ba4698..081063633 100644
--- a/toolsrc/src/vcpkg/install.cpp
+++ b/toolsrc/src/vcpkg/install.cpp
@@ -386,7 +386,7 @@ namespace vcpkg::Install
}
else if (const auto remove_action = action.remove_action.get())
{
- Remove::perform_remove_plan_action(paths, *remove_action, Remove::Purge::YES, status_db);
+ Remove::perform_remove_plan_action(paths, *remove_action, Remove::Purge::YES, &status_db);
}
else
{
diff --git a/toolsrc/src/vcpkg/remove.cpp b/toolsrc/src/vcpkg/remove.cpp
index 3815c3ce7..3eaf991ce 100644
--- a/toolsrc/src/vcpkg/remove.cpp
+++ b/toolsrc/src/vcpkg/remove.cpp
@@ -18,10 +18,10 @@ namespace vcpkg::Remove
using Dependencies::RequestType;
using Update::OutdatedPackage;
- void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, const StatusParagraphs& status_db)
+ void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, StatusParagraphs* status_db)
{
auto& fs = paths.get_filesystem();
- auto maybe_ipv = status_db.find_all_installed(spec);
+ auto maybe_ipv = status_db->find_all_installed(spec);
Checks::check_exit(
VCPKG_LINE_INFO, maybe_ipv.has_value(), "unable to remove package %s: already removed", spec);
@@ -106,6 +106,8 @@ namespace vcpkg::Remove
{
spgh.state = InstallState::NOT_INSTALLED;
write_update(paths, spgh);
+
+ status_db->insert(std::make_unique<StatusParagraph>(std::move(spgh)));
}
}
@@ -143,7 +145,7 @@ namespace vcpkg::Remove
void perform_remove_plan_action(const VcpkgPaths& paths,
const RemovePlanAction& action,
const Purge purge,
- const StatusParagraphs& status_db)
+ StatusParagraphs* status_db)
{
const std::string display_name = action.spec.to_string();
@@ -285,7 +287,7 @@ namespace vcpkg::Remove
for (const RemovePlanAction& action : remove_plan)
{
- perform_remove_plan_action(paths, action, purge, status_db);
+ perform_remove_plan_action(paths, action, purge, &status_db);
}
Checks::exit_success(VCPKG_LINE_INFO);