return atom in self._atoms or atom in self._nonatoms
def __iter__(self):
- for x in self.getAtoms():
+ self._load()
+ for x in self._atoms:
yield x
-
+ for x in self._nonatoms:
+ yield x
+
def supportsOperation(self, op):
if not op in OPERATIONS:
raise ValueError(op)
raise NotImplementedError()
def containsCPV(self, cpv):
- for a in self.getAtoms():
+ self._load()
+ for a in self._atoms:
if match_from_list(a, [cpv]):
return True
return False
if an error occurs while parsing PROVIDE."""
cpv_slot = "%s:%s" % (cpv, metadata["SLOT"])
cp = dep_getkey(cpv)
- self.getAtoms() # make sure the atoms are loaded
+ self._load() # make sure the atoms are loaded
atoms = self._atommap.get(cp)
if atoms:
best_match = best_match_to_list(cpv_slot, atoms)
class EditablePackageSet(PackageSet):
def update(self, atoms):
- self.getAtoms()
+ self._load()
modified = False
normal_atoms = []
for a in atoms:
self.write()
def remove(self, atom):
- self.getAtoms()
+ self._load()
self._atoms.discard(atom)
self._updateAtomMap()
self.write()
def removePackageAtoms(self, cp):
- for a in list(self.getAtoms()):
+ self._load()
+ for a in list(self._atoms):
if dep_getkey(a) == cp:
self.remove(a)
self.write()
def cleanPackage(self, vardb, cpv):
self.lock()
- worldlist = list(self.getAtoms()) # loads latest from disk
+ self._load() # loads latest from disk
+ worldlist = list(self._atoms)
mykey = cpv_getkey(cpv)
newworldlist = []
for x in worldlist: