raise NotImplementedError(
'Someone added an operator without adding it to intersects')
+ def get_depstr(self):
+ """Returns a string representation of the original dep
+ """
+ uc = self.use_conditional
+ uc = "%s? " % uc if uc is not None else ''
+ return "%s%s" % (uc, self.atom)
+
# vim: set ts=4 sw=4 tw=79:
from gentoolkit import errors
from gentoolkit.atom import Atom
from gentoolkit.cpv import CPV
-from gentoolkit.helpers import uniqify
+from gentoolkit.helpers import uniqify_atoms
from gentoolkit.dbapi import PORTDB, VARDB
from gentoolkit.query import Query
try:
all_depends = depcache[pkgdep]
except KeyError:
- #all_depends = uniqify(pkgdep.get_all_depends())
- all_depends = pkgdep.get_all_depends()
+ all_depends = uniqify_atoms(pkgdep.get_all_depends())
depcache[pkgdep] = all_depends
dep_is_displayed = False
for cpv in chain.from_iterable(BINDB.cp_list(x) for x in installed_cps):
yield cpv
-
+
def print_file(path):
"""Display the contents of a file."""
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: