]> Dogcows Code - chaz/tar/commitdiff
Move testing of the prerequisite archive formats
authorSergey Poznyakoff <gray@gnu.org.ua>
Mon, 23 Feb 2004 10:05:22 +0000 (10:05 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Mon, 23 Feb 2004 10:05:22 +0000 (10:05 +0000)
to the separate function 'prereq'. Do not expect any arguments

tests/before

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