From 97b9e3d31c38d13bcb42bd5e5e9e448ec33ce27f Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Mon, 23 Feb 2004 10:05:22 +0000 Subject: [PATCH] Move testing of the prerequisite archive formats to the separate function 'prereq'. Do not expect any arguments --- tests/before | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) 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 -- 2.45.2