Merge changes from genscripts rev 121 to fix various tracebacks
authorfuzzyray <fuzzyray@gentoo.org>
Thu, 10 Dec 2009 21:21:13 +0000 (21:21 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Thu, 10 Dec 2009 21:21:13 +0000 (21:21 -0000)
svn path=/trunk/gentoolkit/; revision=716

pym/gentoolkit/atom.py
pym/gentoolkit/equery/depends.py
pym/gentoolkit/package.py
pym/gentoolkit/versionmatch.py

index d7823a9acffb15e19c271bc50723769a2d526862..ac49dab79b97b867eb83775f2ff2f2f0ee9f4d0a 100644 (file)
@@ -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:
index df2de9fde09a5b675b5d13e398f17a099d514fc2..b60a0ccbb6269776dc1bfb8ed5cc71facda8b10d 100644 (file)
@@ -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(']'))
index c4e07abd92085c44e68102a934caf3488c51a583..59d50bfbf9c09429b0bc2e93d06ec8855a1c530e 100644 (file)
@@ -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
index 018a531d6924e60d8043f4066a498ded13a353a4..a11cc9aee8f24c2ec21a8806b00e1931874b9228 100644 (file)
@@ -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