shithub: sox

Download patch

ref: 3916a06e88d568bb3939f4226d9ed809260b25be
parent: 2d33a25b2d2eb0c086b7dd668b5321e5de0699f3
author: cbagwell <cbagwell>
date: Wed Dec 20 22:20:14 EST 2006

Fix script to work with Solaris bourne shell

--- a/src/tests.sh
+++ b/src/tests.sh
@@ -26,23 +26,25 @@
   
 convertToAndFrom () {
   while [ $# != 0 ]; do
-    if ! echo $skip|tr " " "\n"|grep -Eq "^$format1$|^$1$"; then
-      getFormat $format1; format1Text=$formatText; format1Flags=$formatFlags
-      getFormat       $1; format2Text=$formatText; format2Flags=$formatFlags
-      ./sox -c $channels -r $rate -n $format1Flags input.$format1 synth $samples's' sin 300-3300 noise
-      ./sox $verbose -r $rate -c $channels $format1Flags input.$format1 $format2Flags intermediate.$1
-      ./sox $verbose -r $rate -c $channels $format2Flags intermediate.$1 $format1Flags output.$format1
+      format1_skip=`echo ${format1} | grep $skip`
+      from_skip=`echo ${1} | grep ${skip}`
+      if [ "${format1_skip}x" = "x" -a "${from_skip}x" = "x" ] ; then
+        getFormat ${format1}; format1Text=$formatText; format1Flags=$formatFlags
+        getFormat       $1; format2Text=$formatText; format2Flags=$formatFlags
+        ./sox -c $channels -r $rate -n $format1Flags input.$format1 synth $samples's' sin 300-3300 noise
+        ./sox $verbose -r $rate -c $channels $format1Flags input.$format1 $format2Flags intermediate.$1
+        ./sox $verbose -r $rate -c $channels $format2Flags intermediate.$1 $format1Flags output.$format1
 
-      if cmp -s input.$format1 output.$format1
-      then
-	echo "ok     channels=$channels \"$format1Text\" <--> \"$format2Text\"."
-      else
-	echo "*FAIL* channels=$channels \"$format1Text\" <--> \"$format2Text\"."
-	exit 1    # This allows failure inspection.
+        if cmp -s input.$format1 output.$format1
+        then
+	  echo "ok     channels=$channels \"$format1Text\" <--> \"$format2Text\"."
+        else
+	  echo "*FAIL* channels=$channels \"$format1Text\" <--> \"$format2Text\"."
+	  exit 1    # This allows failure inspection.
+        fi
+        rm -f input.$format1 intermediate.$1 output.$format1
       fi
-      rm -f input.$format1 intermediate.$1 output.$format1
-    fi
-    shift
+      shift
   done
 }