From 91e0cff038076d1f79ac707cfc024a1d919a93a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 27 May 2008 22:35:50 +0200 Subject: Also have masked package being looked up in the updater. Though this is still misbehavior, as packages shouldn't be masked at this point of time --- portato/gui/updater.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'portato') diff --git a/portato/gui/updater.py b/portato/gui/updater.py index f293fbc..44bc4e1 100644 --- a/portato/gui/updater.py +++ b/portato/gui/updater.py @@ -15,7 +15,7 @@ from __future__ import absolute_import from ..backend import system import threading, subprocess, time -from ..helper import debug, error +from ..helper import debug, warning, error class Updater (object): """ @@ -79,21 +79,26 @@ q """ self.stopEvent.set() - def find (self, pv): + def find (self, pv, masked = False): """ As qlop only returns 'package-version' we need to assign it to a cpv. This is done here. """ - pkgs = system.find_packages("=%s" % pv, only_cpv = True) + pkgs = system.find_packages("=%s" % pv, only_cpv = True, masked = masked) if len(pkgs) > 1: # ambigous - try to find the one which is also in the iterators for p in pkgs: if p in self.iterators: return p elif not pkgs: # nothing found =| - error(_("Trying to remove package '%s' from queue which does not exist in system."), pv) - return None + if not masked: + warning(_("No unmasked version of package '%s' found. Trying masked ones. This normally should not happen...")) + return self.find(pv, True) + + else: + error(_("Trying to remove package '%s' from queue which does not exist in system."), pv) + return None else: # only one choice =) return pkgs[0] -- cgit v1.2.3