X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=tests%2Fbefore;h=5733c4111d6cc9206afc6d25ee625e9ceae0dec7;hb=5a9174376b2e5f16caac14a6de3dc3c21c5f8b68;hp=6ddf3cfa2e22e5d81a8c2f540bb71b9a3c7fe3df;hpb=74d29bc5de297d8039f0a0ef646fbeb3e72bcbac;p=chaz%2Ftar diff --git a/tests/before b/tests/before index 6ddf3cf..5733c41 100755 --- a/tests/before +++ b/tests/before @@ -17,20 +17,22 @@ exec 1> stdout exec 2> stderr PATH=..:../../src:$PATH - -if test $# -ne 0; then - case $TAR_OPTIONS in - --format=*) FMTOPT=$TAR_OPTIONS;; - *) FMTOPT=`tar --show-defaults`;; - esac - - FORMAT= - for option - do - case $FMTOPT in - --format=$option*) FORMAT=$option - break;; + +prereq() { + if test $# -ne 0; then + case $TAR_OPTIONS in + --format=*) FMTOPT=$TAR_OPTIONS;; + *) FMTOPT=`tar --show-defaults`;; esac - done - test -z "$FORMAT" && exit 77 -fi + + FORMAT= + for option + do + case $FMTOPT in + --format=$option*) FORMAT=$option + break;; + esac + done + test -z "$FORMAT" && exit 77 + fi +} \ No newline at end of file