[Swift-commit] r7432 - branches/release-0.94/libexec

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Sat Dec 14 19:38:33 CST 2013


Author: davidk
Date: 2013-12-14 19:38:32 -0600 (Sat, 14 Dec 2013)
New Revision: 7432

Modified:
   branches/release-0.94/libexec/_swiftwrap
Log:
A few fixes for CDM
Make sure that SKIPPED_OUTPUT gets appended correctly, and that contains() matches for all elements in an array


Modified: branches/release-0.94/libexec/_swiftwrap
===================================================================
--- branches/release-0.94/libexec/_swiftwrap	2013-12-13 21:41:41 UTC (rev 7431)
+++ branches/release-0.94/libexec/_swiftwrap	2013-12-15 01:38:32 UTC (rev 7432)
@@ -152,16 +152,17 @@
 }
 
 contains() {
-	ARRAY=$1
-	X=$2
+   arrayName=$1[@]
+   array=("${!arrayName}")
+   searchString=$2
 
-	for a in ${!ARRAY}
-	do
-		if [[ ${a} == ${X} ]]; then
-			return 0
-		fi
-	done
-	return 1
+   for element in "${array[@]}" ; do
+      if [ "$element" == "$searchString" ]; then
+         return 0
+      fi  
+   done
+
+   return 1
 }
 
 genScripts() {
@@ -446,7 +447,7 @@
 			if [[ $CDM_POLICY != "DEFAULT" &&
 				  $CDM_POLICY != "BROADCAST"* ]]; then
 	    	    eval cdm_action $DIR "OUTPUT" $L $CDM_POLICY
-				SKIPPED_OUTPUT=( $SKIPPED_OUTPUT $L )
+				SKIPPED_OUTPUT+=( $L )
 			fi
 			if [ $CDM_POLICY == "GATHER" ]; then
 				GATHER_OUTPUT=( $GATHER_OUTPUT $L )




More information about the Swift-commit mailing list