[Swift-commit] r3684 - trunk/libexec

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Sun Oct 17 14:44:22 CDT 2010


Author: hategan
Date: 2010-10-17 14:44:22 -0500 (Sun, 17 Oct 2010)
New Revision: 3684

Modified:
   trunk/libexec/_swiftwrap
Log:
fixed argument passing when using parameter files

Modified: trunk/libexec/_swiftwrap
===================================================================
--- trunk/libexec/_swiftwrap	2010-10-17 14:15:22 UTC (rev 3683)
+++ trunk/libexec/_swiftwrap	2010-10-17 19:44:22 UTC (rev 3684)
@@ -128,6 +128,16 @@
 	return 1
 }
 
+genScripts() {
+	echo "#!/bin/bash" > run.sh
+	echo -n "\"$EXEC\" " >> run.sh
+	for CMDARG in "${CMDARGS[@]}"; do
+    	echo -n "\"$CMDARG\" " >> run.sh
+	done
+	echo "1>\"$STDOUT\" 2>\"$STDERR\"" >> run.sh
+	chmod +x run.sh	
+}
+
 cdm_local_output()
 {
  	L=$1
@@ -273,7 +283,7 @@
 			CMDARGS=("$line")
 			FIRST=0
 		else
-			CMDARGS=("${CMDARGS[*]}" "$line")
+			CMDARGS=("${CMDARGS[@]}" "$line")
 		fi
 	done < <(grep -E "^-a " $PARAMFILE | cut -d " " -f 2-)
 else
@@ -403,16 +413,12 @@
 if [ "$KICKSTART" == "" ]; then
 	if [ "$STDIN" == "" ]; then
 		if [ "$SWIFT_GEN_SCRIPTS" != "" ]; then
-			echo "#!/bin/bash" > run.sh
-			echo "\"$EXEC\" \"${CMDARGS[@]}\" 1>\"$STDOUT\" 2>\"$STDERR\"" >> run.sh
-			chmod +x run.sh
+			genScripts
 		fi
 		"$EXEC" "${CMDARGS[@]}" 1>"$STDOUT" 2>"$STDERR"
 	else
 		if [ "$SWIFT_GEN_SCRIPTS" != "" ]; then
-			echo "#!/bin/bash" > run.sh
-			echo "\"$EXEC\" \"${CMDARGS[@]}\" 1>\"$STDOUT\" 2>\"$STDERR\" <\"$STDIN\"" >> run.sh
-			chmod +x run.sh
+			genScripts
 		fi
 		"$EXEC" "${CMDARGS[@]}" 1>"$STDOUT" 2>"$STDERR" <"$STDIN"
 	fi




More information about the Swift-commit mailing list