Explorar el Código

Move testing of the prerequisite archive formats
to the separate function 'prereq'. Do not expect any arguments

Sergey Poznyakoff hace 21 años
padre
commit
97b9e3d31c
Se han modificado 1 ficheros con 18 adiciones y 16 borrados
  1. 18 16
      tests/before

+ 18 - 16
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
+}