27
class UpdateOrigin(object):
28
def __init__(self, desc, importance):
30
self.importance = importance
31
self.description = desc
27
33
class UpdateList(object):
29
35
class that contains the list of available updates in
30
36
self.pkgs[origin] where origin is the user readable string
34
def __init__(self, desc, importance):
36
self.importance = importance
37
self.description = desc
39
39
def __init__(self, parent):
40
40
# a map of packages under their origin
59
59
("%s-security" % dist, "Ubuntu", _("Important security updates"),10),
60
60
("%s-updates" % dist, "Ubuntu", _("Recommended updates"), 9),
61
61
("%s-proposed" % dist, "Ubuntu", _("Proposed updates"), 8),
62
("%s-backports" % dist, "Ubuntu", _("Backports"), 7),
63
(dist, "Ubuntu", _("Distribution updates"), 6)
62
(dist, "Ubuntu", _("Distribution updates"), 7),
63
("%s-backports" % dist, "Ubuntu", _("Backports"), 6),
66
66
for (origin, archive, desc, importance) in matcher_templates:
67
matcher[(origin, archive)] = self.UpdateOrigin(desc, importance)
68
matcher[(None,None)] = self.UpdateOrigin(_("Other updates"), -1)
67
matcher[(origin, archive)] = UpdateOrigin(desc, importance)
68
matcher[(None,None)] = UpdateOrigin(_("Other updates"), -1)
71
71
def update(self, cache):
75
75
self.distUpgradeWouldDelete = cache.saveDistUpgrade()
77
dselect_upgrade_origin = self.UpdateOrigin(_("Previous selected"), 1)
81
if pkg.isUpgradable or pkg.markedInstall:
79
if (pkg.isUpgradable or
81
cache.notAutomaticUpgradable(pkg)):
82
82
if pkg.candidateOrigin == None:
83
83
# can happen for e.g. locked packages
84
84
# FIXME: do something more sensible here (but what?)