Lines 15-20
assert() {
Link Here
|
15 |
done |
15 |
done |
16 |
} |
16 |
} |
17 |
|
17 |
|
|
|
18 |
assert_tar_extract() { |
19 |
# When extracting a tar file like this: |
20 |
# |
21 |
# bzip2 -dc foo.tar.bz2 | tar xof - |
22 |
# |
23 |
# For some tar files (see bug #309001), tar will |
24 |
# close its stdin pipe when the decompressor still has |
25 |
# remaining data to be written to its stdout pipe. This |
26 |
# causes the decompressor to be killed by SIGPIPE. In |
27 |
# this case, we want to ignore pipe writers killed by |
28 |
# SIGPIPE, and trust the exit status of tar. We refer |
29 |
# to the bash manual section "3.7.5 Exit Status" |
30 |
# which says, "When a command terminates on a fatal |
31 |
# signal whose number is N, Bash uses the value 128+N |
32 |
# as the exit status." |
33 |
|
34 |
local x pipestatus=${PIPESTATUS[*]} |
35 |
for x in $pipestatus ; do |
36 |
# Allow SIGPIPE through (128 + 13) |
37 |
[[ $x -ne 0 && $x -ne 141 ]] && die "$@" |
38 |
done |
39 |
|
40 |
# Require normal success for the last process (tar). |
41 |
[[ $x -eq 0 ]] || die "$@" |
42 |
} |
43 |
|
18 |
shopt -s extdebug |
44 |
shopt -s extdebug |
19 |
|
45 |
|
20 |
# dump_trace([number of funcs on stack to skip], |
46 |
# dump_trace([number of funcs on stack to skip], |
21 |
- |
|
|