diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-12-24 04:00:46 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-12-24 04:00:46 +0000 |
commit | b81d21bd93514e91fb7681788acda0496418062c (patch) | |
tree | be3c61ca85cd4904063e41a917b7039a151f8566 /bin | |
parent | a2aaad42a73d78f445c3ce997c50922315111ebd (diff) | |
download | portage-b81d21bd93514e91fb7681788acda0496418062c.tar.gz portage-b81d21bd93514e91fb7681788acda0496418062c.tar.bz2 portage-b81d21bd93514e91fb7681788acda0496418062c.zip |
Fix the assert alias to avoid 'value to great for base' messages in some cases.
Thanks to Jonathan Callen <abcd@g.o> for reporting. (trunk r15121)
svn path=/main/branches/2.1.7/; revision=15135
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/isolated-functions.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 893ce57ba..bf0bb16b8 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -5,10 +5,16 @@ # We need this next line for "die" and "assert". It expands # It _must_ preceed all the calls to die and assert. shopt -s expand_aliases -alias assert='_pipestatus="${PIPESTATUS[*]}"; [[ "${_pipestatus// /}" -eq 0 ]] || die' alias save_IFS='[ "${IFS:-unset}" != "unset" ] && old_IFS="${IFS}"' alias restore_IFS='if [ "${old_IFS:-unset}" != "unset" ]; then IFS="${old_IFS}"; unset old_IFS; else unset IFS; fi' +assert() { + local x pipestatus=${PIPESTATUS[*]} + for x in $pipestatus ; do + [[ $x -eq 0 ]] || die "$@" + done +} + shopt -s extdebug # dump_trace([number of funcs on stack to skip], @@ -519,7 +525,8 @@ save_ebuild_env() { done unset x - unset -f dump_trace die diefunc quiet_mode vecho elog_base eqawarn elog \ + unset -f assert dump_trace die diefunc \ + quiet_mode vecho elog_base eqawarn elog \ esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \ KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \ has_phase_defined_up_to \ |