summaryrefslogtreecommitdiffstats
path: root/pym/portage/sets/files.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/sets/files.py')
-rw-r--r--pym/portage/sets/files.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pym/portage/sets/files.py b/pym/portage/sets/files.py
index acf556b7f..035c2dc99 100644
--- a/pym/portage/sets/files.py
+++ b/pym/portage/sets/files.py
@@ -294,8 +294,13 @@ class WorldSet(EditablePackageSet):
self._lock = None
def cleanPackage(self, vardb, cpv):
- self.lock()
- self._load() # loads latest from disk
+ '''
+ Before calling this function you should call lock and load.
+ After calling this function you should call unlock.
+ '''
+ if not self._lock:
+ raise AssertionError('cleanPackage needs the set to be locked')
+
worldlist = list(self._atoms)
mykey = cpv_getkey(cpv)
newworldlist = []
@@ -317,7 +322,6 @@ class WorldSet(EditablePackageSet):
newworldlist.extend(self._nonatoms)
self.replace(newworldlist)
- self.unlock()
def singleBuilder(self, options, settings, trees):
return WorldSet(settings["ROOT"])