Scheduler: optimize action_uninstall
authorZac Medico <zmedico@gentoo.org>
Thu, 5 Apr 2012 18:52:51 +0000 (11:52 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 5 Apr 2012 18:52:51 +0000 (11:52 -0700)
pym/_emerge/Scheduler.py
pym/_emerge/actions.py

index 8d6ab9fb8c5a33278f804988021147a5881b72cc..5500acfbb385a65b4f48d011d076453675ac0537 100644 (file)
@@ -135,7 +135,8 @@ class Scheduler(PollScheduler):
                        portage.exception.PortageException.__init__(self, value)
 
        def __init__(self, settings, trees, mtimedb, myopts,
-               spinner, mergelist=None, favorites=None, graph_config=None):
+               spinner, mergelist=None, favorites=None, graph_config=None,
+               uninstall_only=False):
                PollScheduler.__init__(self)
 
                if mergelist is not None:
@@ -151,6 +152,7 @@ class Scheduler(PollScheduler):
                self._spinner = spinner
                self._mtimedb = mtimedb
                self._favorites = favorites
+               self._uninstall_only = uninstall_only
                self._args_set = InternalPackageSet(favorites, allow_repo=True)
                self._build_opts = self._build_opts_class()
 
@@ -327,6 +329,8 @@ class Scheduler(PollScheduler):
                self._blocker_db = {}
                dynamic_deps = self.myopts.get("--dynamic-deps", "y") != "n"
                for root in self.trees:
+                       if self._uninstall_only:
+                               continue
                        if graph_config is None:
                                fake_vartree = FakeVartree(self.trees[root]["root_config"],
                                        pkg_cache=self._pkg_cache, dynamic_deps=dynamic_deps)
index 22c3e265f1ab4b5a4100768c337e5b3f63af3777..9c87120500b91fe35c8f65b5553a668a3d9e7cf6 100644 (file)
@@ -2657,7 +2657,7 @@ def action_uninstall(settings, trees, ldpath_mtimes,
        # redirection of ebuild phase output to logs as required for
        # options such as --quiet.
        sched = Scheduler(settings, trees, None, opts,
-               spinner)
+               spinner, uninstall_only=True)
        sched._background = sched._background_mode()
        sched._status_display.quiet = True