From: fuzzyray Date: Thu, 10 Dec 2009 21:21:13 +0000 (-0000) Subject: Merge changes from genscripts rev 121 to fix various tracebacks X-Git-Tag: gentoolkit-0.3.0_rc10~35 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7a63d307efed6c3545abc55c31918410c0a2077c;p=gentoolkit.git Merge changes from genscripts rev 121 to fix various tracebacks svn path=/trunk/gentoolkit/; revision=716 --- diff --git a/pym/gentoolkit/atom.py b/pym/gentoolkit/atom.py index d7823a9..ac49dab 100644 --- a/pym/gentoolkit/atom.py +++ b/pym/gentoolkit/atom.py @@ -238,8 +238,10 @@ class Atom(portage.dep.Atom, CPV): # Slot dep only matters if we both have one. If we do they # must be identical: - if (self.slot is not None and other.slot is not None and - self.slot != other.slot): + this_slot = getattr(self, 'slot', None) + that_slot = getattr(other, 'slot', None) + if (this_slot is not None and that_slot is not None and + this_slot != that_slot): return False # TODO: Uncomment when Portage's Atom supports repo @@ -252,9 +254,11 @@ class Atom(portage.dep.Atom, CPV): # cares about a flag it is irrelevant. # Skip the (very common) case of one of us not having use deps: - if self.use and other.use: + this_use = getattr(self, 'use', None) + that_use = getattr(other, 'use', None) + if this_use and that_use: # Set of flags we do not have in common: - flags = set(self.use.tokens) ^ set(other.use.tokens) + flags = set(this_use.tokens) ^ set(that_use.tokens) for flag in flags: # If this is unset and we also have the set version we fail: if flag[0] == '-' and flag[1:] in flags: diff --git a/pym/gentoolkit/equery/depends.py b/pym/gentoolkit/equery/depends.py index df2de9f..b60a0cc 100644 --- a/pym/gentoolkit/equery/depends.py +++ b/pym/gentoolkit/equery/depends.py @@ -81,7 +81,7 @@ class DependPrinter(object): else: formatted_dep = mdep.operator + str(mdep.cpv) if mdep.slot: - formatted_dep += pp.emph(':') + pp.slot(mdep.slot) + formatted_dep += pp.emph(':') + pp.slot(','.join(mdep.slot)) if mdep.use: useflags = pp.useflag(','.join(mdep.use.tokens)) formatted_dep += (pp.emph('[') + useflags + pp.emph(']')) diff --git a/pym/gentoolkit/package.py b/pym/gentoolkit/package.py index c4e07ab..59d50bf 100644 --- a/pym/gentoolkit/package.py +++ b/pym/gentoolkit/package.py @@ -345,7 +345,7 @@ class PackageFormatter(object): 'slot': self.pkg.get_env_var("SLOT") } else: - return self.pkg.cpv + return str(self.pkg.cpv) def format_package_location(self): """Get the install status (in /var/db/?) and origin (from and overlay diff --git a/pym/gentoolkit/versionmatch.py b/pym/gentoolkit/versionmatch.py index 018a531..a11cc9a 100644 --- a/pym/gentoolkit/versionmatch.py +++ b/pym/gentoolkit/versionmatch.py @@ -45,7 +45,7 @@ class VersionMatch(object): if not isinstance(cpv, CPV): raise ValueError("cpv must be a gentoolkit.cpv.CPV instance") - #self.cpv = cpv + self.cpv = cpv self.operator = op self.version = cpv.version self.revision = cpv.revision