self._required_set_names = set(["world"])
- self.excluded_pkgs = InternalPackageSet()
+ self.excluded_pkgs = InternalPackageSet(allow_wildcard=True)
for x in ' '.join(myopts.get("--exclude", [])).split():
try:
x = Atom(x, allow_wildcard=True)
self._load()
return self._nonatoms.copy()
- def _setAtoms(self, atoms):
+ def _setAtoms(self, atoms, allow_wildcard=False):
self._atoms.clear()
self._nonatoms.clear()
for a in atoms:
except InvalidAtom:
self._nonatoms.add(a)
continue
+ if not allow_wildcard and a.extended_syntax:
+ raise InvalidAtom("extended atom syntax not allowed here")
self._atoms.add(a)
self._updateAtomMap()
class EditablePackageSet(PackageSet):
+ def __init__(self, allow_wildcard=False):
+ super(EditablePackageSet, self).__init__()
+ self._allow_wildcard = allow_wildcard
+
def update(self, atoms):
self._load()
modified = False
modified = True
self._nonatoms.add(a)
continue
+ if not self._allow_wildcard and a.extended_syntax:
+ raise InvalidAtom("extended atom syntax not allowed here")
normal_atoms.append(a)
if normal_atoms:
self.update([atom])
def replace(self, atoms):
- self._setAtoms(atoms)
+ self._setAtoms(atoms, allow_wildcard=self._allow_wildcard)
self.write()
def remove(self, atom):
raise NotImplementedError()
class InternalPackageSet(EditablePackageSet):
- def __init__(self, initial_atoms=None):
- super(InternalPackageSet, self).__init__()
+ def __init__(self, initial_atoms=None, allow_wildcard=False):
+ super(InternalPackageSet, self).__init__(allow_wildcard=allow_wildcard)
if initial_atoms != None:
self.update(initial_atoms)