aboutsummaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorBrian Dolbec <brian.dolbec@gmail.com>2011-02-10 21:49:11 -0800
committerBrian Dolbec <brian.dolbec@gmail.com>2011-02-10 21:50:59 -0800
commit768096f120ac1aec161416e284eeec97ef376b3d (patch)
tree53ad61950881f5c66b0c3456c38034bf8d1e42ce /pym
parentfix the missing unset flags issue due to my misleading variable name for "cle... (diff)
downloadgentoolkit-768096f120ac1aec161416e284eeec97ef376b3d.tar.gz
gentoolkit-768096f120ac1aec161416e284eeec97ef376b3d.tar.bz2
gentoolkit-768096f120ac1aec161416e284eeec97ef376b3d.zip
apply djanderson's idea for a simpler/better fix to bug 353430 and commit 000ce49860b253ad6c917c5a58bc0ff31225134a for
use conditionals causing errors in equery results.
Diffstat (limited to 'pym')
-rw-r--r--pym/gentoolkit/atom.py17
-rw-r--r--pym/gentoolkit/dependencies.py4
-rw-r--r--pym/gentoolkit/helpers.py14
3 files changed, 13 insertions, 22 deletions
diff --git a/pym/gentoolkit/atom.py b/pym/gentoolkit/atom.py
index fe9adaa..7282fac 100644
--- a/pym/gentoolkit/atom.py
+++ b/pym/gentoolkit/atom.py
@@ -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:
diff --git a/pym/gentoolkit/dependencies.py b/pym/gentoolkit/dependencies.py
index 6aadc35..feced63 100644
--- a/pym/gentoolkit/dependencies.py
+++ b/pym/gentoolkit/dependencies.py
@@ -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
diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index cf1b138..cd8b763 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -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: