Fix some _doebuild_exit_status_check() calls so that they only happen when
authorZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 06:59:41 +0000 (06:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 06:59:41 +0000 (06:59 -0000)
the bash process exits successfully (for consistency with usage elsewhere).
When calling this functions, we're mainly concerned about false success, and
we always want to allow things like using bashrc die hooks to clean up
$PORTAGE_BUILDDIR for users that are building in tmpfs (in which case the
exit status file may be removed before bash exits). (trunk r13296)

svn path=/main/branches/2.1.6/; revision=13467

pym/portage/__init__.py

index 27dd62787b19d3fdcdfb72559c232db6e9d85cff..a0b93747c74cf19dc218c76dc1400d6edc4c5c24 100644 (file)
@@ -4738,13 +4738,15 @@ def spawnebuild(mydo, actionmap, mysettings, debug, alwaysdep=0,
 
        if returnpid:
                return phase_retval
-       msg = _doebuild_exit_status_check(mydo, mysettings)
-       if msg:
-               phase_retval = 1
-               from textwrap import wrap
-               from portage.elog.messages import eerror
-               for l in wrap(msg, 72):
-                       eerror(l, phase=mydo, key=mysettings.mycpv)
+
+       if phase_retval == os.EX_OK:
+               msg = _doebuild_exit_status_check(mydo, mysettings)
+               if msg:
+                       phase_retval = 1
+                       from textwrap import wrap
+                       from portage.elog.messages import eerror
+                       for l in wrap(msg, 72):
+                               eerror(l, phase=mydo, key=mysettings.mycpv)
 
        _post_phase_userpriv_perms(mysettings)
        if mydo == "install":
@@ -5017,13 +5019,14 @@ def _spawn_misc_sh(mysettings, commands, **kwargs):
                        logfile=logfile, **kwargs)
        finally:
                pass
-       msg = _doebuild_exit_status_check(mydo, mysettings)
-       if msg:
-               rval = 1
-               from textwrap import wrap
-               from portage.elog.messages import eerror
-               for l in wrap(msg, 72):
-                       eerror(l, phase=mydo, key=mysettings.mycpv)
+       if rval == os.EX_OK:
+               msg = _doebuild_exit_status_check(mydo, mysettings)
+               if msg:
+                       rval = 1
+                       from textwrap import wrap
+                       from portage.elog.messages import eerror
+                       for l in wrap(msg, 72):
+                               eerror(l, phase=mydo, key=mysettings.mycpv)
        return rval
 
 _testing_eapis = frozenset()