As suggested by Chr. Schaefer in bug #211833, comment #15, note that
authorZac Medico <zmedico@gentoo.org>
Mon, 28 Apr 2008 17:20:42 +0000 (17:20 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 28 Apr 2008 17:20:42 +0000 (17:20 -0000)
removal of the environment.bz2 file is preferred since it may allow the
removal phases to execute successfully.

svn path=/main/trunk/; revision=10022

pym/portage/dbapi/vartree.py

index a758f213040caf7704882e890978bb2f689f4a87..7a2dae37d72bf61b35d40d8b969388b1bcee34ce 100644 (file)
@@ -1299,18 +1299,13 @@ 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_lines = []
                                                        msg = ("The '%s' " % ebuild_phase) + \
                                                        ("phase of the '%s' package " % self.mycpv) + \
                                                        ("has failed with exit value %s." % retval)
-                                                       
                                                        from textwrap import wrap
-                                                       msg = wrap(msg, 72)
-                                                       msg.append("")
-                                                       _eerror(msg)
+                                                       msg_lines.extend(wrap(msg, 72))
+                                                       msg_lines.append("")
 
                                                        ebuild_name = os.path.basename(myebuildpath)
                                                        ebuild_dir = os.path.dirname(myebuildpath)
@@ -1319,21 +1314,25 @@ class dblink(object):
                                                        ("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)
+                                                       "the environment.bz2 file and/or the " + \
+                                                       "ebuild 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 the eclasses " + \
+                                                       "of the environment.bz2 file is " + \
+                                                       "preferred since it may allow the " + \
+                                                       "removal phases to execute successfully. " + \
+                                                       "The ebuild will be " + \
+                                                       "sourced and the eclasses " + \
                                                        "from the current portage tree will be used " + \
                                                        "when necessary. Removal of " + \
                                                        "the ebuild file will cause the " + \
                                                        "removal phases to be skipped entirely."
-                                                       msg = wrap(msg, 72)
-                                                       _eerror(msg)
+                                                       msg_lines.extend(wrap(msg, 72))
+                                                       from portage.elog.messages import eerror
+                                                       for l in msg_lines:
+                                                               eerror(l, phase=ebuild_phase, key=self.mycpv)
 
                                                # process logs created during pre/postrm
                                                elog_process(self.mycpv, self.settings, phasefilter=filter_unmergephases)