Merge lp:~evfool/software-center/lp668382 into lp:software-center

Proposed by Robert Roth
Status: Merged
Merged at revision: 3241
Proposed branch: lp:~evfool/software-center/lp668382
Merge into: lp:software-center
Diff against target: 26 lines (+3/-4)
1 file modified
softwarecenter/distro/ubuntu.py (+3/-4)
To merge this branch: bzr merge lp:~evfool/software-center/lp668382
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Review via email: mp+135429@code.launchpad.net

Description of the change

This branch fixes bug #668382:
* the removal warning text for core items in ubuntu (to match the wiki spec [1])
* fixed the logic to correctly work with important metapackages, as without this fix if there was a metapackage in the depends of the package to remove, the depends got set to [], so there was no chance to find any of the IMPORTANT_METAPACKAGES in the (already empty) depends
[1] https://wiki.ubuntu.com/SoftwarePackageOperations#removing

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks Robert! The logic is indeed wrong, great that you noticed that. I tweaked your fix a tiny bit and just changed the order of the loops. I.e. the more important core meta pacakges loop is run first, then the less important check for generic metapackages.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/distro/ubuntu.py'
--- softwarecenter/distro/ubuntu.py 2012-08-08 11:20:12 +0000
+++ softwarecenter/distro/ubuntu.py 2012-11-21 14:50:26 +0000
@@ -99,19 +99,18 @@
99 "Are you sure you want to continue?") % (appname,99 "Are you sure you want to continue?") % (appname,
100 cache[m].installed.summary)100 cache[m].installed.summary)
101 button_text = _("Remove Anyway")101 button_text = _("Remove Anyway")
102 depends = []
103 break102 break
104103
105 # alter it if an important meta-package is affected104 # alter it if an important meta-package is affected
106 for m in self.IMPORTANT_METAPACKAGES:105 for m in self.IMPORTANT_METAPACKAGES:
107 if m in depends:106 if m in depends:
108 primary = _("%s is a core application in Ubuntu. "107 primary = _("%s is a core item in Ubuntu. "
109 "Uninstalling it may cause future upgrades "108 "Removing it may cause future upgrades "
110 "to be incomplete. Are you sure you want to "109 "to be incomplete. Are you sure you want to "
111 "continue?") % appname110 "continue?") % appname
112 button_text = _("Remove Anyway")111 button_text = _("Remove Anyway")
113 depends = None
114 break112 break
113 depends = None
115 return (primary, button_text)114 return (primary, button_text)
116115
117 def get_license_text(self, component):116 def get_license_text(self, component):