diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-07-22 00:24:27 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-07-22 00:24:27 +0000 |
commit | c4de481fffdf47e6f17668ada3548ef1189f7e7b (patch) | |
tree | 055817dff330b2f52901fa464f359d6ce64cfdda | |
parent | 26d6a4f30c30d395ab661eaff11aec846f6170f3 (diff) | |
download | portage-c4de481fffdf47e6f17668ada3548ef1189f7e7b.tar.gz portage-c4de481fffdf47e6f17668ada3548ef1189f7e7b.tar.bz2 portage-c4de481fffdf47e6f17668ada3548ef1189f7e7b.zip |
Adjust --fetchonly failure messages to work better with background mode.
svn path=/main/trunk/; revision=11159
-rw-r--r-- | pym/_emerge/__init__.py | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 3ddb7be5f..04037d6b9 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -29,6 +29,7 @@ import logging import select import shlex import shutil +import textwrap import urlparse import weakref import gc @@ -2402,8 +2403,9 @@ class EbuildBuild(CompositeTask): if opts.fetchonly: if self._final_exit(fetcher) != os.EX_OK: - eerror("!!! Fetch for %s failed, continuing..." % pkg.cpv, - phase="unpack", key=pkg.cpv) + if not self.background: + eerror("Fetch for %s failed, continuing..." % pkg.cpv, + phase="unpack", key=pkg.cpv) self.wait() return @@ -9075,15 +9077,26 @@ class Scheduler(PollScheduler): "--fetch-all-uri" in self.myopts): return - sys.stderr.write("\n\n!!! Some fetch errors were " + \ - "encountered. Please see above for details.\n\n") + if self._background: + msg = "Some fetch errors were " + \ + "encountered. Please see %s for details." % \ + self._fetch_log + else: + msg = "Some fetch errors were " + \ + "encountered. Please see above for details." - for cpv in failed_fetches: - sys.stderr.write(" ") - sys.stderr.write(cpv) - sys.stderr.write("\n") + prefix = bad(" * ") + msg = "".join("%s%s\n" % (prefix, line) \ + for line in textwrap.wrap(msg, 70)) + writemsg_level(msg, level=logging.ERROR, noiselevel=-1) - sys.stderr.write("\n") + msg = [] + msg.append("") + for cpv in failed_fetches: + msg.append(" %s" % cpv) + msg.append("") + writemsg_level("".join("%s%s\n" % (prefix, line) \ + for line in msg), level=logging.ERROR, noiselevel=-1) def _is_restart_scheduled(self): """ |