From 74d29bc5de297d8039f0a0ef646fbeb3e72bcbac Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Fri, 20 Feb 2004 15:35:19 +0000 Subject: [PATCH] Accept an optional list of allowed archive formats. Exit with the status 77 if the current archive format does not match any of them. --- tests/before | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/before b/tests/before index 4347922..6ddf3cf 100755 --- a/tests/before +++ b/tests/before @@ -17,3 +17,20 @@ 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;; + esac + done + test -z "$FORMAT" && exit 77 +fi -- 2.45.2