From 7e64644da36c0f464f227e458d237d301d36b040 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 28 Apr 2008 03:41:31 +0000 Subject: [PATCH] Try to format the elog message better for bug #211833, separating paragraphs for easier reading. (trunk r10018) svn path=/main/branches/2.1.2/; revision=10019 --- pym/portage.py | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index 9b5f0ff54..673e75e03 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -8674,24 +8674,38 @@ class dblink: try: if myebuildpath: if retval != os.EX_OK: + msg_lines = [] 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_lines.extend(wrap(msg, 72)) + msg_lines.append("") + + 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_lines.extend(wrap(msg, 72)) + msg_lines.append("") + + 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." + msg_lines.extend(wrap(msg, 72)) from textwrap import wrap cmd = "source '%s/isolated-functions.sh' ; " % \ PORTAGE_BIN_PATH - for l in wrap(msg, 72): + for l in msg_lines: cmd += "eerror \"%s\" ; " % l portage_exec.spawn(["bash", "-c", cmd], env=self.settings.environ()) -- 2.26.2