Try to format the elog message better for bug #211833, separating
authorZac Medico <zmedico@gentoo.org>
Mon, 28 Apr 2008 03:41:31 +0000 (03:41 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 28 Apr 2008 03:41:31 +0000 (03:41 -0000)
paragraphs for easier reading. (trunk r10018)

svn path=/main/branches/2.1.2/; revision=10019

pym/portage.py

index 9b5f0ff542a75fac9d29e075563e65e0ce23c218..673e75e033a8ff2b136d4f05c39e4553eae76cb6 100644 (file)
@@ -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())