summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/Scheduler.py
diff options
context:
space:
mode:
authorMounir Lamouri <volkmar@gentoo.org>2009-08-15 19:28:53 +0000
committerMounir Lamouri <volkmar@gentoo.org>2009-08-15 19:28:53 +0000
commit2aa5871b1a92d6224b6a28bb7c30ea931d0f5b72 (patch)
tree1cfde6d716e32d830621be3b53dcdee81e22e20f /pym/_emerge/Scheduler.py
parent3273deb3408f0b460954e97f0a815a2485d0c2d8 (diff)
downloadportage-2aa5871b1a92d6224b6a28bb7c30ea931d0f5b72.tar.gz
portage-2aa5871b1a92d6224b6a28bb7c30ea931d0f5b72.tar.bz2
portage-2aa5871b1a92d6224b6a28bb7c30ea931d0f5b72.zip
Scheduler is now able to clean world set when removing a package.
world_atom function has been updated and PackageUninstall is calling it after unmerge. svn path=/main/trunk/; revision=14070
Diffstat (limited to 'pym/_emerge/Scheduler.py')
-rw-r--r--pym/_emerge/Scheduler.py34
1 files changed, 21 insertions, 13 deletions
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index cef4ee6ca..1e05aac0f 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1566,8 +1566,8 @@ class Scheduler(PollScheduler):
def _world_atom(self, pkg):
"""
- Add the package to the world file, but only if
- it's supposed to be added. Otherwise, do nothing.
+ Add or remove the package to the world file, but only if
+ it's supposed to be added or removed. Otherwise, do nothing.
"""
if set(("--buildpkgonly", "--fetchonly",
@@ -1596,17 +1596,25 @@ class Scheduler(PollScheduler):
if hasattr(world_set, "load"):
world_set.load() # maybe it's changed on disk
- atom = create_world_atom(pkg, args_set, root_config)
- if atom:
- if hasattr(world_set, "add"):
- self._status_msg(('Recording %s in "world" ' + \
- 'favorites file...') % atom)
- logger.log(" === (%s of %s) Updating world file (%s)" % \
- (pkg_count.curval, pkg_count.maxval, pkg.cpv))
- world_set.add(atom)
- else:
- writemsg_level('\n!!! Unable to record %s in "world"\n' % \
- (atom,), level=logging.WARN, noiselevel=-1)
+ if pkg.operation == "uninstall":
+ if hasattr(world_set, "cleanPackage"):
+ world_set.cleanPackage(pkg.root_config.trees["vartree"].dbapi,
+ pkg.cpv)
+ if hasattr(world_set, "remove"):
+ for s in pkg.root_config.setconfig.active:
+ world_set.remove(SETPREFIX+s)
+ else:
+ atom = create_world_atom(pkg, args_set, root_config)
+ if atom:
+ if hasattr(world_set, "add"):
+ self._status_msg(('Recording %s in "world" ' + \
+ 'favorites file...') % atom)
+ logger.log(" === (%s of %s) Updating world file (%s)" % \
+ (pkg_count.curval, pkg_count.maxval, pkg.cpv))
+ world_set.add(atom)
+ else:
+ writemsg_level('\n!!! Unable to record %s in "world"\n' % \
+ (atom,), level=logging.WARN, noiselevel=-1)
finally:
if world_locked:
world_set.unlock()