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): |
376 | 376 | elif not self.add_bundle(install_path): |
377 | 377 | raise RegistrationException |
378 | 378 | |
379 | | def uninstall(self, bundle, force=False): |
| 379 | def uninstall(self, bundle, force=False, upgrade=False): |
380 | 380 | # TODO treat ContentBundle in special way |
381 | 381 | # needs rethinking while fixing ContentBundle support |
382 | 382 | if isinstance(bundle, ContentBundle) or \ |
… |
… |
class BundleRegistry(gobject.GObject): |
399 | 399 | |
400 | 400 | install_path = act.get_path() |
401 | 401 | |
402 | | bundle.uninstall(install_path, force) |
| 402 | bundle.uninstall(install_path, force, upgrade) |
403 | 403 | |
404 | 404 | if not self.remove_bundle(install_path): |
405 | 405 | raise RegistrationException |
… |
… |
class BundleRegistry(gobject.GObject): |
413 | 413 | return |
414 | 414 | elif act.is_user_activity(): |
415 | 415 | try: |
416 | | self.uninstall(bundle, force=True) |
| 416 | self.uninstall(bundle, force=True, upgrade=True) |
417 | 417 | except Exception: |
418 | 418 | logging.error('Uninstall failed, still trying to install ' \ |
419 | 419 | 'newer bundle:\n' + \ |