Merged from trunk -r15118:15121
authorFabian Groffen <grobian@gentoo.org>
Sun, 20 Dec 2009 17:48:38 +0000 (17:48 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 20 Dec 2009 17:48:38 +0000 (17:48 -0000)
   | 15119   | Fix the assert alias to 'value to great for base' messages   |
   | zmedico | in some cases. Thanks to Jonathan Callen <abcd@g.o> for      |
   |         | reporting.                                                   |

   | 15120   | Revert previous commit because it's no comptible (doesn't    |
   | zmedico | pass arguments to die).                                      |

   | 15121   | Fix the assert alias to avoid 'value to great for base'      |
   | zmedico | messages in some cases. Thanks to Jonathan Callen <abcd@g.o> |
   |         | for reporting.                                               |

svn path=/main/branches/prefix/; revision=15123

bin/isolated-functions.sh

index 5ae13fa1bd30de83e2b69ed8a9ca698c9b02c48f..cfb8fbddd68e80974e1b67bf939750fcef6fe3b8 100755 (executable)
@@ -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],
@@ -527,7 +533,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 \