aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/accounts/accounts_id.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/accounts/accounts_id.cc')
-rw-r--r--paludis/repositories/accounts/accounts_id.cc32
1 files changed, 28 insertions, 4 deletions
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index b1d10bfc9..a89cc840f 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -421,6 +421,19 @@ AccountsID::supports_action(const SupportsActionTestBase & test) const
return simple_visitor_cast<const SupportsActionTest<InstallAction> >(test);
}
+namespace
+{
+ std::tr1::shared_ptr<OutputManager> this_output_manager(const std::tr1::shared_ptr<OutputManager> & o, const Action &)
+ {
+ return o;
+ }
+
+ void used_this_for_config_protect(std::string & s, const std::string & v)
+ {
+ s = v;
+ }
+}
+
void
AccountsID::perform_action(Action & action) const
{
@@ -436,6 +449,8 @@ AccountsID::perform_action(Action & action) const
std::tr1::shared_ptr<OutputManager> output_manager(install_action->options.make_output_manager()(
*install_action));
+ std::string used_config_protect;
+
switch (install_action->options.want_phase()("merge"))
{
case wp_yes:
@@ -447,7 +462,9 @@ AccountsID::perform_action(Action & action) const
value_for<n::options>(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs),
value_for<n::output_manager>(output_manager),
value_for<n::package_id>(shared_from_this()),
- value_for<n::used_this_for_config_protect>(install_action->options.used_this_for_config_protect())
+ value_for<n::perform_uninstall>(install_action->options.perform_uninstall()),
+ value_for<n::used_this_for_config_protect>(std::tr1::bind(
+ &used_this_for_config_protect, std::tr1::ref(used_config_protect), std::tr1::placeholders::_1))
));
}
break;
@@ -462,8 +479,6 @@ AccountsID::perform_action(Action & action) const
throw InternalError(PALUDIS_HERE, "bad WantPhase");
}
- output_manager->succeeded();
-
for (PackageIDSequence::ConstIterator i(install_action->options.replacing()->begin()), i_end(install_action->options.replacing()->end()) ;
i != i_end ; ++i)
{
@@ -472,7 +487,16 @@ AccountsID::perform_action(Action & action) const
&& (*i)->name() == name())
continue;
else
- install_action->options.perform_uninstall()(*i);
+ {
+ UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
+ value_for<n::config_protect>(used_config_protect),
+ value_for<n::is_overwrite>(false),
+ value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, output_manager, std::tr1::placeholders::_1))
+ ));
+ install_action->options.perform_uninstall()(*i, uo);
+ }
}
+
+ output_manager->succeeded();
}