Lines 17-23
assert() {
Link Here
|
17 |
done |
17 |
done |
18 |
} |
18 |
} |
19 |
|
19 |
|
20 |
__assert_sigpipe_ok() { |
20 |
__helpers_assert_sigpipe_ok() { |
21 |
# When extracting a tar file like this: |
21 |
# When extracting a tar file like this: |
22 |
# |
22 |
# |
23 |
# bzip2 -dc foo.tar.bz2 | tar xof - |
23 |
# bzip2 -dc foo.tar.bz2 | tar xof - |
Lines 36-46
__assert_sigpipe_ok() {
Link Here
|
36 |
local x pipestatus=${PIPESTATUS[*]} |
36 |
local x pipestatus=${PIPESTATUS[*]} |
37 |
for x in $pipestatus ; do |
37 |
for x in $pipestatus ; do |
38 |
# Allow SIGPIPE through (128 + 13) |
38 |
# Allow SIGPIPE through (128 + 13) |
39 |
[[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && die "$@" |
39 |
[[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && __helpers_die "$@" |
40 |
done |
40 |
done |
41 |
|
41 |
|
42 |
# Require normal success for the last process (tar). |
42 |
# Require normal success for the last process (tar). |
43 |
[[ $x -eq 0 ]] || die "$@" |
43 |
[[ $x -eq 0 ]] || __helpers_die "$@" |
44 |
} |
44 |
} |
45 |
|
45 |
|
46 |
shopt -s extdebug |
46 |
shopt -s extdebug |
Lines 92-117
nonfatal() {
Link Here
|
92 |
die "$FUNCNAME() not supported in this EAPI" |
92 |
die "$FUNCNAME() not supported in this EAPI" |
93 |
fi |
93 |
fi |
94 |
if [[ $# -lt 1 ]]; then |
94 |
if [[ $# -lt 1 ]]; then |
95 |
die "$FUNCNAME(): Missing argument" |
95 |
# Well they said nonfatal and forgot to finish their sentence. |
|
|
96 |
# Something ain't right, to be sure, but die()ing here seems a bit |
97 |
# pendantic and mean-spirited :) |
98 |
local phase_str= |
99 |
[[ -n ${EBUILD_PHASE} ]] && phase_str=" (${EBUILD_PHASE} phase)" |
100 |
eerror "ERROR: ${CATEGORY}/${PF}${phase_str}:" |
101 |
eerror " ${FUNCNAME}: Missing argument" |
102 |
eerror |
103 |
return 1 |
96 |
fi |
104 |
fi |
97 |
|
105 |
|
98 |
PORTAGE_NONFATAL=1 "$@" |
106 |
PORTAGE_NONFATAL=1 "$@" |
99 |
} |
107 |
} |
100 |
|
108 |
|
101 |
__helpers_die() { |
109 |
__helpers_die() { |
102 |
if ___eapi_helpers_can_die; then |
110 |
if ___eapi_helpers_can_die && [[ "${PORTAGE_NONFATAL:-0}" != 1 ]]; then |
103 |
die "$@" |
111 |
die "$@" |
104 |
else |
112 |
else |
105 |
echo -e "$@" >&2 |
113 |
local phase_str= |
|
|
114 |
[[ -n ${EBUILD_PHASE} ]] && phase_str=" (${EBUILD_PHASE} phase)" |
115 |
ewarn "WARNING: ${CATEGORY}/${PF}${phase_str}:" |
116 |
ewarn " ${FUNCNAME}: ${*:-(no error message)}" |
117 |
ewarn |
106 |
fi |
118 |
fi |
107 |
} |
119 |
} |
108 |
|
120 |
|
109 |
die() { |
121 |
die() { |
110 |
if [[ $PORTAGE_NONFATAL -eq 1 ]]; then |
|
|
111 |
echo -e " $WARN*$NORMAL ${FUNCNAME[1]}: WARNING: $@" >&2 |
112 |
return 1 |
113 |
fi |
114 |
|
115 |
set +e |
122 |
set +e |
116 |
if [ -n "${QA_INTERCEPTORS}" ] ; then |
123 |
if [ -n "${QA_INTERCEPTORS}" ] ; then |
117 |
# die was called from inside inherit. We need to clean up |
124 |
# die was called from inside inherit. We need to clean up |