diff options
author | 2010-08-06 01:21:47 -0700 | |
---|---|---|
committer | 2010-08-06 01:21:47 -0700 | |
commit | b9226939dc1b50d7b77e8ac99112d468b2140b52 (patch) | |
tree | daa2bbe9333b38762856f849db6873f1ba020f18 | |
parent | Pass more parameters to the Package constructor. (diff) | |
download | portage-multirepo-b9226939dc1b50d7b77e8ac99112d468b2140b52.tar.gz portage-multirepo-b9226939dc1b50d7b77e8ac99112d468b2140b52.tar.bz2 portage-multirepo-b9226939dc1b50d7b77e8ac99112d468b2140b52.zip |
In action_unmerge(), create a Schuduler instance for calls to unmerge(),
in order to cause redirection of ebuild phase output to logs as required
for options such as --quiet.
-rw-r--r-- | pym/_emerge/Scheduler.py | 1 | ||||
-rw-r--r-- | pym/_emerge/actions.py | 23 |
2 files changed, 18 insertions, 6 deletions
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index 94391fc8..c6af547f 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -345,6 +345,7 @@ class Scheduler(PollScheduler): def _set_digraph(self, digraph): if "--nodeps" in self.myopts or \ + digraph is None or \ (self._max_jobs is not True and self._max_jobs < 2): # save some memory self._digraph = None diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index e8c6e3ad..9de45f44 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -515,7 +515,7 @@ def action_config(settings, trees, myopts, myfiles): print() def action_depclean(settings, trees, ldpath_mtimes, - myopts, action, myfiles, spinner): + myopts, action, myfiles, spinner, scheduler=None): # Kill packages that aren't explicitly merged or are required as a # dependency of another package. World file is explicit. @@ -576,7 +576,8 @@ def action_depclean(settings, trees, ldpath_mtimes, if cleanlist: unmerge(root_config, myopts, "unmerge", - cleanlist, ldpath_mtimes, ordered=ordered) + cleanlist, ldpath_mtimes, ordered=ordered, + scheduler=scheduler) if action == "prune": return @@ -2427,18 +2428,28 @@ def action_uninstall(settings, trees, ldpath_mtimes, for line in textwrap.wrap(msg, 72): out.ewarn(line) + if action == 'deselect': + return action_deselect(settings, trees, opts, valid_atoms) + + # Create a Schuduler for calls to unmerge(), in order to cause + # redirection of ebuild phase output to logs as required for + # options such as --quiet. + sched = Scheduler(settings, trees, None, opts, + spinner, [], [], None) + sched._background = sched._background_mode() + sched._status_display.quiet = True + if action in ('clean', 'unmerge') or \ (action == 'prune' and "--nodeps" in opts): # When given a list of atoms, unmerge them in the order given. ordered = action == 'unmerge' unmerge(trees[settings["ROOT"]]['root_config'], opts, action, - valid_atoms, ldpath_mtimes, ordered=ordered) + valid_atoms, ldpath_mtimes, ordered=ordered, + scheduler=sched._sched_iface) rval = os.EX_OK - elif action == 'deselect': - rval = action_deselect(settings, trees, opts, valid_atoms) else: rval = action_depclean(settings, trees, ldpath_mtimes, - opts, action, valid_atoms, spinner) + opts, action, valid_atoms, spinner, scheduler=sched._sched_iface) return rval |