raise UninstallFailure(retval)
sys.exit(retval)
else:
- if clean_world and hasattr(sets["world"], "cleanPackage"):
+ if clean_world and hasattr(sets["world"], "cleanPackage")\
+ and hasattr(sets["world"], "lock"):
+ sets["world"].lock()
+ if hasattr(sets["world"], "load"):
+ sets["world"].load()
sets["world"].cleanPackage(vartree.dbapi, y)
+ sets["world"].unlock()
emergelog(xterm_titles, " >>> unmerge success: "+y)
- if clean_world and hasattr(sets["world"], "remove"):
+
+ if clean_world and hasattr(sets["world"], "remove")\
+ and hasattr(sets["world"], "lock"):
+ sets["world"].lock()
+ # load is called inside remove()
for s in root_config.setconfig.active:
sets["world"].remove(SETPREFIX+s)
+ sets["world"].unlock()
+
return 1
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 = []
newworldlist.extend(self._nonatoms)
self.replace(newworldlist)
- self.unlock()
def singleBuilder(self, options, settings, trees):
return WorldSet(settings["ROOT"])