apply djanderson's idea for a simpler/better fix to bug 353430 and commit 000ce49860b...
authorBrian Dolbec <brian.dolbec@gmail.com>
Fri, 11 Feb 2011 05:49:11 +0000 (21:49 -0800)
committerBrian Dolbec <brian.dolbec@gmail.com>
Fri, 11 Feb 2011 05:50:59 +0000 (21:50 -0800)
use conditionals causing errors in equery results.

pym/gentoolkit/atom.py
pym/gentoolkit/dependencies.py
pym/gentoolkit/helpers.py

index fe9adaa4bc858eccca3e746fb8580ef61c5f8cd2..7282facab72110a3f2174c99e4f9aab26caf581a 100644 (file)
@@ -81,10 +81,13 @@ class Atom(portage.dep.Atom, CPV):
                        if self.blocker.overlap.forbid != other.blocker.overlap.forbid:
                                return False
 
+               if self.use_conditional != other.use_conditional:
+                       return False
+
                # Don't believe Portage has something like this
                #c = cmp(self.negate_vers, other.negate_vers)
                #if c:
-               #       return c
+               #   return c
 
                if self.slot != other.slot:
                        return False
@@ -133,7 +136,7 @@ class Atom(portage.dep.Atom, CPV):
                # Don't believe Portage has something like this
                #c = cmp(self.negate_vers, other.negate_vers)
                #if c:
-               #       return c
+               #   return c
 
                if self.slot != other.slot:
                        if self.slot is None:
@@ -229,8 +232,8 @@ class Atom(portage.dep.Atom, CPV):
 
                # TODO: Uncomment when Portage's Atom supports repo
                #if (self.repo_name is not None and other.repo_name is not None and
-               #       self.repo_name != other.repo_name):
-               #       return False
+               #   self.repo_name != other.repo_name):
+               #   return False
 
                # Use deps are similar: if one of us forces a flag on and the
                # other forces it off we do not intersect. If only one of us
@@ -247,9 +250,9 @@ class Atom(portage.dep.Atom, CPV):
                                if flag[0] == '-' and flag[1:] in flags:
                                        return False
 
-        # Remaining thing to check is version restrictions. Get the
-        # ones we can check without actual version comparisons out of
-        # the way first.
+               # Remaining thing to check is version restrictions. Get the
+               # ones we can check without actual version comparisons out of
+               # the way first.
 
                # If one of us is unversioned we intersect:
                if not self.operator or not other.operator:
index 6aadc35da64fcb01803d12f531b90532f46139c4..feced635017f7a601022383200c3d92fd11c2d27 100644 (file)
@@ -19,7 +19,7 @@ from portage.dep import paren_reduce
 from gentoolkit import errors
 from gentoolkit.atom import Atom
 from gentoolkit.cpv import CPV
-from gentoolkit.helpers import uniqify_atoms
+from gentoolkit.helpers import uniqify
 from gentoolkit.dbapi import PORTDB, VARDB
 from gentoolkit.query import Query
 
@@ -243,7 +243,7 @@ class Dependencies(Query):
                        try:
                                all_depends = depcache[pkgdep]
                        except KeyError:
-                               all_depends = uniqify_atoms(pkgdep.get_all_depends())
+                               all_depends = uniqify(pkgdep.get_all_depends())
                                depcache[pkgdep] = all_depends
 
                        dep_is_displayed = False
index cf1b138066201aba5480204ce436e741a2e567a7..cd8b763ffbbe731c9f193809a2193eb81c202312 100644 (file)
@@ -7,7 +7,7 @@
 """Miscellaneous helper functions and classes.
 
 @note: find_* functions that previously lived here have moved to
-       the query module, where they are called as: Query('portage').find_*().
+          the query module, where they are called as: Query('portage').find_*().
 """
 
 __all__ = (
@@ -476,16 +476,4 @@ def uniqify(seq, preserve_order=True):
 
        return result
 
-def uniqify_atoms(seq):
-       """Return a uniqified list."""
-       seen = set()
-       result = []
-       for x in seq:
-               dep = x.get_depstr()
-               if dep not in seen:
-                       result.append(x)
-                       seen.add(dep)
-
-       return result
-
 # vim: set ts=4 sw=4 tw=79: