From: Sergey Poznyakoff Date: Mon, 23 Feb 2004 10:05:22 +0000 (+0000) Subject: Move testing of the prerequisite archive formats X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=97b9e3d31c38d13bcb42bd5e5e9e448ec33ce27f;p=chaz%2Ftar Move testing of the prerequisite archive formats to the separate function 'prereq'. Do not expect any arguments --- 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