Explorar o código

Accept an optional list of allowed archive
formats. Exit with the status 77 if the current archive
format does not match any of them.

Sergey Poznyakoff %!s(int64=21) %!d(string=hai) anos
pai
achega
74d29bc5de
Modificáronse 1 ficheiros con 17 adicións e 0 borrados
  1. 17 0
      tests/before

+ 17 - 0
tests/before

@@ -17,3 +17,20 @@ exec 1> stdout
 exec 2> stderr
 exec 2> stderr
 
 
 PATH=..:../../src:$PATH
 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