[sulfur] improve orphaned packages handling
This commit is contained in:
@@ -1684,6 +1684,14 @@ class SulfurApplication(Controller, SulfurApplicationEventsMixin):
|
||||
self.ui.rbUpdatesSimpleLabel.set_markup(txt_adv)
|
||||
self.ui.rbUpdatesLabel.set_markup(txt_adv)
|
||||
|
||||
def _show_packages_group_caching(self):
|
||||
for k in ("installed", "reinstallable", "masked",
|
||||
"user_unmasked", "downgrade"):
|
||||
try:
|
||||
self.etpbase.get_groups(k)
|
||||
except ProgrammingError:
|
||||
continue
|
||||
|
||||
def show_packages(self, back_to_page = None, on_init = False):
|
||||
|
||||
action = self.lastPkgPB
|
||||
@@ -1699,15 +1707,7 @@ class SulfurApplication(Controller, SulfurApplicationEventsMixin):
|
||||
if action == "updates":
|
||||
# speed up first queue taint iteration
|
||||
self.etpbase.get_groups("available")
|
||||
def do_more_caching():
|
||||
for k in ("installed", "reinstallable", "masked",
|
||||
"user_unmasked", "downgrade"):
|
||||
try:
|
||||
self.etpbase.get_groups(k)
|
||||
except ProgrammingError:
|
||||
continue
|
||||
return False
|
||||
gobject.idle_add(do_more_caching)
|
||||
gobject.idle_add(self._show_packages_group_caching)
|
||||
|
||||
# set updates label
|
||||
raw_updates = len(self.etpbase.get_raw_groups('updates'))
|
||||
|
||||
@@ -156,8 +156,13 @@ class EntropyPackage:
|
||||
def __str__(self):
|
||||
if self.pkgset:
|
||||
return self.matched_atom
|
||||
return str(self.dbconn.retrieveAtom(self.matched_id) + "~" + \
|
||||
str(self.dbconn.retrieveRevision(self.matched_id)))
|
||||
return str(self.dbconn.retrieveAtom(self.matched_id) + \
|
||||
etpConst['entropyrevisionprefix'] + \
|
||||
str(self.dbconn.retrieveRevision(self.matched_id))) + \
|
||||
etpConst['entropyrepoprefix'] + self.repoid_clean
|
||||
|
||||
def __repr__(self):
|
||||
return "<EntropyPackage at %s @ %s>" % (id(self), str(self),)
|
||||
|
||||
def __cmp__(self, pkg):
|
||||
if pkg.matched_atom == self.matched_atom:
|
||||
|
||||
@@ -690,6 +690,11 @@ class EntropyPackages:
|
||||
return yp
|
||||
|
||||
def _pkg_get_orphans(self):
|
||||
|
||||
# make sure we have these configured
|
||||
self.get_groups("installed")
|
||||
self.get_groups("reinstallable")
|
||||
|
||||
updates, remove, fine, spm_fine = self.Entropy.calculate_updates(
|
||||
critical_updates = False)
|
||||
# Filter out packages installed from unavailable repositories, this is
|
||||
|
||||
Reference in New Issue
Block a user