From 8cb1b68337ffa125f7e6aaf57e90c4b46c278601 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 10 Jun 2013 21:01:14 -0700 Subject: [PATCH] Correctly remove previous phases. Fixes: bug #1189716 Change-Id: I747e7bbcb2dfccf67b32cc04ea68c153e38ea534 --- anvil/actions/install.py | 3 ++- anvil/actions/remove.py | 7 ++++--- anvil/actions/uninstall.py | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/anvil/actions/install.py b/anvil/actions/install.py index 9255085a..9cbcf058 100644 --- a/anvil/actions/install.py +++ b/anvil/actions/install.py @@ -60,7 +60,7 @@ class InstallAction(action.Action): logger=LOG) def _run(self, persona, component_order, instances): - removals = ['uninstall', 'unconfigure'] + removals = ['unconfigure'] self._run_phase( action.PhaseFunctors( start=lambda i: LOG.info('Configuring %s.', colorizer.quote(i.name)), @@ -104,6 +104,7 @@ class InstallAction(action.Action): LOG.info("Finished install of %s with result %s.", colorizer.quote(instance.name), result) + removals += ["package-uninstall", 'uninstall'] dependency_handler = self.distro.dependency_handler_class( self.distro, self.root_dir, instances.values()) general_package = "general" diff --git a/anvil/actions/remove.py b/anvil/actions/remove.py index 4da63d38..c1385086 100644 --- a/anvil/actions/remove.py +++ b/anvil/actions/remove.py @@ -33,7 +33,7 @@ class RemoveAction(action.Action): return components def _run(self, persona, component_order, instances): - removals = ['install'] + removals = ['package-install', 'install'] general_package = "general" dependency_handler = self.distro.dependency_handler_class( self.distro, self.root_dir, instances.values()) @@ -45,10 +45,11 @@ class RemoveAction(action.Action): ), [general_package], {general_package: instances[general_package]}, - "uninstall", + "package-uninstall", *removals ) + removals += ['prepare', 'download', "download-patch"] self._run_phase( action.PhaseFunctors( start=lambda i: LOG.info('Uninstalling %s.', colorizer.quote(i.name)), @@ -61,7 +62,7 @@ class RemoveAction(action.Action): *removals ) - removals += ['pre-install'] + removals += ['pre-install', 'post-install'] self._run_phase( action.PhaseFunctors( start=lambda i: LOG.info('Post-uninstalling %s.', colorizer.quote(i.name)), diff --git a/anvil/actions/uninstall.py b/anvil/actions/uninstall.py index bcff7a30..be2bd096 100644 --- a/anvil/actions/uninstall.py +++ b/anvil/actions/uninstall.py @@ -45,6 +45,7 @@ class UninstallAction(action.Action): 'unconfigure', *removals ) + removals += ['post-install'] self._run_phase( action.PhaseFunctors( @@ -58,6 +59,7 @@ class UninstallAction(action.Action): *removals ) + removals += ['package-install'] general_package = "general" dependency_handler = self.distro.dependency_handler_class( self.distro, self.root_dir, instances.values()) @@ -69,6 +71,6 @@ class UninstallAction(action.Action): ), [general_package], {general_package: instances[general_package]}, - "uninstall", + "package-uninstall", *removals )