diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-04-10 01:02:29 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-04-10 01:02:29 +0000 |
commit | 3d819dc230439c4bde66d6689744fee6205fb291 (patch) | |
tree | 7523236ec18e0aee97e0352337f9212d9a96ab70 | |
parent | 46abb3e7b0386422960e01e5adc27f2a25fc2973 (diff) | |
download | portage-3d819dc230439c4bde66d6689744fee6205fb291.tar.gz portage-3d819dc230439c4bde66d6689744fee6205fb291.tar.bz2 portage-3d819dc230439c4bde66d6689744fee6205fb291.zip |
Use _doebuild_exit_status_check() for unsuccessful return codes (no just
successful ones), since we want to be sure to produce an informative warning
message whenever the shell exits unexpectedly (whether it's successful or
unsuccessful). This is important since it can be makes these kinds of issues
easier to diagnose (otherwise the user might blame portage, when it's really
the ebuild/eclasses that is at fault).
svn path=/main/trunk/; revision=13311
-rw-r--r-- | pym/portage/__init__.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 65ee6e5c8..f9dd70d53 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -4751,14 +4751,14 @@ def spawnebuild(mydo, actionmap, mysettings, debug, alwaysdep=0, if returnpid: return phase_retval - if phase_retval == os.EX_OK: - msg = _doebuild_exit_status_check(mydo, mysettings) - if msg: + msg = _doebuild_exit_status_check(mydo, mysettings) + if msg: + if phase_retval == os.EX_OK: 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) + 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": @@ -5031,14 +5031,16 @@ def _spawn_misc_sh(mysettings, commands, **kwargs): logfile=logfile, **kwargs) finally: pass - if rval == os.EX_OK: - msg = _doebuild_exit_status_check(mydo, mysettings) - if msg: + + msg = _doebuild_exit_status_check(mydo, mysettings) + if msg: + if rval == os.EX_OK: 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) + 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(["3_pre1"]) @@ -5577,11 +5579,10 @@ def _doebuild_exit_status_check(mydo, settings): return msg def _doebuild_exit_status_check_and_log(settings, mydo, retval): - if retval != os.EX_OK: - return retval msg = _doebuild_exit_status_check(mydo, settings) if msg: - retval = 1 + if retval == os.EX_OK: + retval = 1 from textwrap import wrap from portage.elog.messages import eerror for l in wrap(msg, 72): @@ -5809,11 +5810,10 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, _doebuild_manifest_cache = mf def exit_status_check(retval): - if retval != os.EX_OK: - return retval msg = _doebuild_exit_status_check(mydo, mysettings) if msg: - retval = 1 + if retval == os.EX_OK: + retval = 1 from textwrap import wrap from portage.elog.messages import eerror for l in wrap(msg, 72): |