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
1=== modified file 'softwarecenter/distro/ubuntu.py'
2--- softwarecenter/distro/ubuntu.py 2012-08-08 11:20:12 +0000
3+++ softwarecenter/distro/ubuntu.py 2012-11-21 14:50:26 +0000
4@@ -99,19 +99,18 @@
5 "Are you sure you want to continue?") % (appname,
6 cache[m].installed.summary)
7 button_text = _("Remove Anyway")
8- depends = []
9 break
10
11 # alter it if an important meta-package is affected
12 for m in self.IMPORTANT_METAPACKAGES:
13 if m in depends:
14- primary = _("%s is a core application in Ubuntu. "
15- "Uninstalling it may cause future upgrades "
16+ primary = _("%s is a core item in Ubuntu. "
17+ "Removing it may cause future upgrades "
18 "to be incomplete. Are you sure you want to "
19 "continue?") % appname
20 button_text = _("Remove Anyway")
21- depends = None
22 break
23+ depends = None
24 return (primary, button_text)
25
26 def get_license_text(self, component):