def __init__(self, atom=None, **kwargs):
DependencyArg.__init__(self, **kwargs)
self.atom = atom
+ if not isinstance(self.atom, portage.dep.Atom):
+ self.atom = portage.dep.Atom(self.atom)
self.set = (self.atom, )
class PackageArg(DependencyArg):
def __init__(self, package=None, **kwargs):
DependencyArg.__init__(self, **kwargs)
self.package = package
- self.atom = "=" + package.cpv
+ self.atom = portage.dep.Atom("=" + package.cpv)
self.set = (self.atom, )
class SetArg(DependencyArg):
# $Id$
from portage import cpv_getkey, flatten
-from portage.dep import isvalidatom, match_from_list, \
+from portage.dep import Atom, isvalidatom, match_from_list, \
best_match_to_list, dep_getkey, use_reduce, paren_reduce
from portage.exception import InvalidAtom
return self._nonatoms.copy()
def _setAtoms(self, atoms):
- atoms = map(str.strip, atoms)
+ self._atoms.clear()
self._nonatoms.clear()
- for a in atoms[:]:
- if a == "":
- atoms.remove(a)
- elif not isvalidatom(a):
- atoms.remove(a)
+ for a in atoms:
+ a = a.strip()
+ if not a:
+ continue
+ try:
+ self._atoms.add(Atom(a))
+ except InvalidAtom:
self._nonatoms.add(a)
- self._atoms = set(atoms)
self._updateAtomMap()
def load(self):