summaryrefslogtreecommitdiff
path: root/geneticone/backend
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--geneticone/backend/package.py19
-rw-r--r--geneticone/backend/portage_helper.py13
2 files changed, 23 insertions, 9 deletions
diff --git a/geneticone/backend/package.py b/geneticone/backend/package.py
index 8991117..0f53e3c 100644
--- a/geneticone/backend/package.py
+++ b/geneticone/backend/package.py
@@ -31,15 +31,26 @@ class Package (gentoolkit.Package):
if isinstance(cpv, gentoolkit.Package):
cpv = cpv.get_cpv()
gentoolkit.Package.__init__(self, cpv)
- self._status = portage.getmaskingstatus(self.get_cpv(), settings = gentoolkit.settings)
+ try:
+ self._status = portage.getmaskingstatus(self.get_cpv(), settings = gentoolkit.settings)
+ except KeyError: # package is not located in the system
+ self._status = None
+ def is_in_system (self):
+ """Returns False if the package could not be found in the portage system.
+
+ @return: True if in portage system; else False
+ @rtype: boolean"""
+
+ return (self._status != None)
+
def is_missing_keyword(self):
"""Returns True if the package is missing the needed keyword.
@return: True if keyword is missing; else False
@rtype: boolean"""
- if "missing keyword" in self._status:
+ if self._status and "missing keyword" in self._status:
return True
return False
@@ -60,7 +71,7 @@ class Package (gentoolkit.Package):
else: # keywords are taken into account
status = flags.new_testing_status(self.get_cpv())
if status == None: # we haven't changed it in any way
- if testArch+" keyword" in self._status:
+ if self._status and testArch+" keyword" in self._status:
return True
return False
else:
@@ -92,7 +103,7 @@ class Package (gentoolkit.Package):
else:
debug("BUG in flags.new_masking_status. It returns",status)
else: # we have not touched the status
- if "profile" in self._status or "package.mask" in self._status:
+ if self._status and ("profile" in self._status or "package.mask" in self._status):
return True
return False
diff --git a/geneticone/backend/portage_helper.py b/geneticone/backend/portage_helper.py
index 9faf953..3a6eab7 100644
--- a/geneticone/backend/portage_helper.py
+++ b/geneticone/backend/portage_helper.py
@@ -260,6 +260,7 @@ def update_world (newuse = False, deep = False):
checked = []
updating = []
+ raw_checked = []
def check (p, deep = False):
"""Checks whether a package is updated or not."""
if p.get_cp() in checked: return
@@ -277,11 +278,13 @@ def update_world (newuse = False, deep = False):
if deep:
for i in p.get_matched_dep_packages():
- bm = find_best_match(i)
- if not bm:
- debug("Bug? No best match could be found:",i)
- else:
- check(bm, deep)
+ if i not in raw_checked:
+ raw_checked.append(i)
+ bm = find_best_match(i)
+ if not bm:
+ debug("Bug? No best match could be found:",i)
+ else:
+ check(bm, deep)
for p in packages:
if not p: continue # if a masked package is installed we have "None" here