]> Dogcows Code - chaz/tar/commitdiff
Accept an optional list of allowed archive
authorSergey Poznyakoff <gray@gnu.org.ua>
Fri, 20 Feb 2004 15:35:19 +0000 (15:35 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Fri, 20 Feb 2004 15:35:19 +0000 (15:35 +0000)
formats. Exit with the status 77 if the current archive
format does not match any of them.

tests/before

index 43479221804947355f9d8b1c103350c03d614bb8..6ddf3cfa2e22e5d81a8c2f540bb71b9a3c7fe3df 100755 (executable)
@@ -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
This page took 0.021594 seconds and 4 git commands to generate.