diff options
author | shanjit@seeta.in <shanjit@seeta.in> | 2010-10-25 14:01:27 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2010-10-25 22:27:52 (GMT) |
commit | c63b43ccee18da78b3398298ca89feba15f4db50 (patch) | |
tree | 9f84d525bbb1c24ace904bbf88757912480ed2f2 /src/jarabe/model/bundleregistry.py | |
parent | 26801b1b3bd994f1e749051b28d0675f0cccff3f (diff) |
Downgrading activities not allowed. (SL #2164)
Activity can be downgraded on the availability of an older .xo version of an
activity. An alert pops up when trying to install an older .xo file of an
activity, which asks the user to make a selection on whether to move to an
older activity version or not.
Co-authored-by: Shanjit Singh Jajmann <shanjit@seeta.in>
Co-authored-by: Anubhav Aggarwal <anubhav@seeta.in>
Diffstat (limited to 'src/jarabe/model/bundleregistry.py')
-rw-r--r-- | src/jarabe/model/bundleregistry.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py index 699e339..4de7e3f 100644 --- a/src/jarabe/model/bundleregistry.py +++ b/src/jarabe/model/bundleregistry.py @@ -373,14 +373,17 @@ class BundleRegistry(gobject.GObject): return True return False - def install(self, bundle, uid=None): + def install(self, bundle, uid=None, force_downgrade=False): activities_path = env.get_user_activities_path() for installed_bundle in self._bundles: if bundle.get_bundle_id() == installed_bundle.get_bundle_id() and \ bundle.get_activity_version() <= \ installed_bundle.get_activity_version(): - raise AlreadyInstalledException + if not force_downgrade: + raise AlreadyInstalledException + else: + self.uninstall(installed_bundle, force=True) elif bundle.get_bundle_id() == installed_bundle.get_bundle_id(): self.uninstall(installed_bundle, force=True) |