X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=tests%2Fremfiles01.at;h=1fb0fadc547d67c91974af11a2e56d343d79a1ad;hb=38f082c50347e6d90cb93307c1077c68cd238d76;hp=940fd953af79f1f154f103d83fced9f0429468d6;hpb=3322ff6164a1e9dd3d1622c64a9b9b7c5f303ef6;p=debian%2Ftar diff --git a/tests/remfiles01.at b/tests/remfiles01.at index 940fd953..1fb0fadc 100644 --- a/tests/remfiles01.at +++ b/tests/remfiles01.at @@ -30,7 +30,9 @@ AT_KEYWORDS([create remove-files remfiles01 gzip]) unset TAR_OPTIONS AT_CHECK([ +AT_UNPRIVILEGED_PREREQ AT_GZIP_PREREQ +AT_SIGPIPE_PREREQ AT_SORT_PREREQ mkdir dir @@ -46,7 +48,11 @@ mkdir c # or # tar: Child returned status 2 -tar -c -f a -z --remove-files b c 2>err +# Discard diagnostics that some shells generate about broken pipes, +# and discard all of tar's diagnostics except for the ones saying "(child)". +# Gzip's exit code is propagated to the shell. Usually it is 141. +# Convert all non-zero exits to 2 to make it predictable. +(tar -c -f a -z --remove-files b c 2>err || (exit 2) ) 2>/dev/null EC=$? sed -n '/(child)/p' err >&2 rm err