diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-07-18 01:42:38 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-07-18 01:42:38 +0000 |
commit | 83b72e26e2961db83532bfc2c325d23a4f141758 (patch) | |
tree | c062d16429be1b6032003fcd719b9a6bce38dc5f | |
parent | 43d0545119b66e6196508d40bae884df3ffa2a4f (diff) | |
download | portage-83b72e26e2961db83532bfc2c325d23a4f141758.tar.gz portage-83b72e26e2961db83532bfc2c325d23a4f141758.tar.bz2 portage-83b72e26e2961db83532bfc2c325d23a4f141758.zip |
Change package status messages to give more accurate information about what
is happening at a given time:
* Change "Emerging" messages to "Building" for ebuilds and "Extracting" for
binary packages.
* Change "Merging" messages to "Installing" and "Uninstalling".
svn path=/main/trunk/; revision=11121
-rw-r--r-- | pym/_emerge/__init__.py | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index d2f8dc2e1..bb9e72588 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -3336,15 +3336,22 @@ class MergeListItem(CompositeTask): world_atom = self.world_atom ldpath_mtimes = mtimedb["ldpath"] + action_desc = "Building" + preposition = "for" + if pkg.type_name == "binary": + action_desc = "Extracting" + if not build_opts.pretend: extra_newline = "\n" if self.background: extra_newline = "" portage.writemsg_stdout( - extra_newline + ">>> Emerging (%s of %s) %s to %s\n" % \ - (colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)), + "%s>>> %s (%s of %s) %s %s %s\n" % \ + (extra_newline, action_desc, + colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)), colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)), - colorize("GOOD", pkg.cpv), pkg.root), noiselevel=-1) + colorize("GOOD", pkg.cpv), preposition, pkg.root), + noiselevel=-1) logger.log(" >>> emerge (%s of %s) %s to %s" % \ (pkg_count.curval, pkg_count.maxval, pkg.cpv, pkg.root)) @@ -3432,6 +3439,30 @@ class PackageMerge(AsynchronousTask): __slots__ = ("merge",) def _start(self): + + pkg = self.merge.pkg + pkg_count = self.merge.pkg_count + + if pkg.installed: + + action_desc = "Uninstalling" + preposition = "from" + + portage.writemsg_stdout( + ">>> %s %s %s %s\n" % \ + (action_desc, colorize("GOOD", pkg.cpv), + preposition, pkg.root), noiselevel=-1) + + else: + + action_desc = "Installing" + preposition = "to" + + portage.writemsg_stdout( + ">>> %s %s %s %s\n" % \ + (action_desc, colorize("GOOD", pkg.cpv), + preposition, pkg.root), noiselevel=-1) + self.returncode = self.merge.merge() self.wait() @@ -8776,27 +8807,12 @@ class Scheduler(PollScheduler): background = self._max_jobs > 1 log_path = settings.get("PORTAGE_LOG_FILE") - if phase == "preinst": - msg = ">>> Merging %s to %s\n" % (pkg.cpv, pkg.root) - if not background: - portage.writemsg_stdout(msg) - if log_path is not None: - self._append_to_log_path(log_path, msg) - ebuild_phase = EbuildPhase(background=background, pkg=pkg, phase=phase, scheduler=scheduler, settings=settings, tree=pkg_dblink.treetype) ebuild_phase.start() ebuild_phase.wait() - if phase == "postinst" and \ - ebuild_phase.returncode == os.EX_OK: - msg = ">>> %s %s\n" % (pkg.cpv, "merged.") - if not background: - portage.writemsg_stdout(msg) - if log_path is not None: - self._append_to_log_path(log_path, msg) - return ebuild_phase.returncode def _check_manifests(self): |