Ticket #2074: 0002-Differ-activity-uninstall-delete-upgrade-scenarios.2.patch

File 0002-Differ-activity-uninstall-delete-upgrade-scenarios.2.patch, 2.1 KB (added by tch, 11 years ago)
  • src/jarabe/model/bundleregistry.py

    From 5308a04cdd3c2a79d86550390c4cd196fd2d94bb Mon Sep 17 00:00:00 2001
    From: Martin Abente <mabente@paraguayeduca.org>
    Date: Mon, 5 Jul 2010 14:09:36 -0400
    Subject: [PATCH] Differ activity uninstall delete-upgrade scenarios
    Organization: Paraguay Educa
    
    The current activities upgrade logic requires previous version
    uninstall. This patch adds a new a parameter to the bundleregistry
    uninstall method to differentiate the delete and upgrade scenarios.
    
    This differentiation makes sence when deleting bundle profile data.
    Which is not necessary in upgrade scenario.
    
    More info at http://bugs.sugarlabs.org/ticket/2074
    
    Signed-off-by: Martin Abente <mabente@paraguayeduca.org>
    ---
     src/jarabe/model/bundleregistry.py |    6 +++---
     1 files changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
    index 86a2738..3e9410a 100644
    a b class BundleRegistry(gobject.GObject): 
    376376        elif not self.add_bundle(install_path):
    377377            raise RegistrationException
    378378
    379     def uninstall(self, bundle, force=False):       
     379    def uninstall(self, bundle, force=False, upgrade=False):
    380380        # TODO treat ContentBundle in special way
    381381        # needs rethinking while fixing ContentBundle support
    382382        if isinstance(bundle, ContentBundle) or \
    class BundleRegistry(gobject.GObject): 
    399399
    400400        install_path = act.get_path()
    401401
    402         bundle.uninstall(install_path, force)
     402        bundle.uninstall(install_path, force, upgrade)
    403403
    404404        if not self.remove_bundle(install_path):
    405405            raise RegistrationException
    class BundleRegistry(gobject.GObject): 
    413413            return
    414414        elif act.is_user_activity():
    415415            try:
    416                 self.uninstall(bundle, force=True)
     416                self.uninstall(bundle, force=True, upgrade=True)
    417417            except Exception:
    418418                logging.error('Uninstall failed, still trying to install ' \
    419419                    'newer bundle:\n' + \