[Swift-commit] r6140 - trunk/bin

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Mon Jan 7 17:35:17 CST 2013


Author: davidk
Date: 2013-01-07 17:35:16 -0600 (Mon, 07 Jan 2013)
New Revision: 6140

Modified:
   trunk/bin/gensites
   trunk/bin/swiftrun
Log:
Specify a swift.properties/cf to swiftrun for auto tc.data generation
Have gensites just cat the template when no replacements need to happen


Modified: trunk/bin/gensites
===================================================================
--- trunk/bin/gensites	2013-01-07 22:11:52 UTC (rev 6139)
+++ trunk/bin/gensites	2013-01-07 23:35:16 UTC (rev 6140)
@@ -212,4 +212,10 @@
    fi
    SED_COMMAND+="-e s@"\_$value\_"@${!value}@g "
 done
-$SED_COMMAND $TEMPLATE_PATH
+len=$( echo $SED_COMMAND |wc -w )
+if [ $len -gt 1 ]; then
+   $SED_COMMAND $TEMPLATE_PATH
+else
+   cat $TEMPLATE_PATH
+fi
+

Modified: trunk/bin/swiftrun
===================================================================
--- trunk/bin/swiftrun	2013-01-07 22:11:52 UTC (rev 6139)
+++ trunk/bin/swiftrun	2013-01-07 23:35:16 UTC (rev 6140)
@@ -47,6 +47,7 @@
 do
    case "$1" in
       -site|-sites|-s) SITES=$2; verify_not_null sites $SITES; shift ;;
+      -config|-c) CONFIG=$2; verify_nul_null config $CONFIG; shift ;;
       *) if [ -z "$args" ]; then script="$1"
          else args+="$1"
          fi ;;
@@ -64,7 +65,11 @@
 echo "<config>" > $rundir/sites.xml
 for site in $SITES
 do
-   gensites -l $site >> $rundir/sites.xml
+   if [ -f "$CONFIG" ]; then
+      gensites -p $CONFIG -l $site >> $rundir/sites.xml
+   else
+      gensites -l $site >> $rundir/sites.xml
+   fi
 done
 echo "</config>" >> $rundir/sites.xml
 




More information about the Swift-commit mailing list