From 2a3295fefbab199a4d7a61b82a321b8d5f4a8a32 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 28 Apr 2008 03:35:41 +0000 Subject: [PATCH] Try to format the elog message better for bug #211833, separating paragraphs for easier reading. svn path=/main/trunk/; revision=10018 --- pym/portage/dbapi/vartree.py | 41 +++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 02b148417..a758f2130 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1299,24 +1299,41 @@ class dblink(object): try: if myebuildpath: if retval != os.EX_OK: + from portage.elog.messages import eerror + def _eerror(lines): + for l in lines: + eerror(l, phase=ebuild_phase, key=self.mycpv) msg = ("The '%s' " % ebuild_phase) + \ ("phase of the '%s' package " % self.mycpv) + \ - ("has failed with exit value %s. " % retval) + \ - "The problem occurred while executing " + \ - ("the ebuild located at '%s'. " % myebuildpath) + \ - "If necessary, manually remove the ebuild " + \ - "and/or the environment.bz2 file which " + \ - "is located in the same directory. Removal " + \ + ("has failed with exit value %s." % retval) + + from textwrap import wrap + msg = wrap(msg, 72) + msg.append("") + _eerror(msg) + + ebuild_name = os.path.basename(myebuildpath) + ebuild_dir = os.path.dirname(myebuildpath) + msg = "The problem occurred while executing " + \ + ("the ebuild file named '%s' " % ebuild_name) + \ + ("located in the '%s' directory. " \ + % ebuild_dir) + \ + "If necessary, manually remove " + \ + "the ebuild file and/or the environment.bz2 " + \ + "file located in that directory." + msg = wrap(msg, 72) + msg.append("") + _eerror(msg) + + msg = "Removal " + \ "of the environment.bz2 file will cause " + \ - "the ebuild to be sourced and eclasses " + \ + "the ebuild to be sourced and the eclasses " + \ "from the current portage tree will be used " + \ "when necessary. Removal of " + \ - "the ebuild will cause the execution of " + \ + "the ebuild file will cause the " + \ "removal phases to be skipped entirely." - from portage.elog.messages import eerror - from textwrap import wrap - for l in wrap(msg, 72): - eerror(l, phase=ebuild_phase, key=self.mycpv) + msg = wrap(msg, 72) + _eerror(msg) # process logs created during pre/postrm elog_process(self.mycpv, self.settings, phasefilter=filter_unmergephases) -- 2.26.2