You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2010/04/26 14:28:14 UTC
svn commit: r938018 -
/incubator/lcf/trunk/modules/framework/scripts/executecommand.sh
Author: kwright
Date: Mon Apr 26 12:28:14 2010
New Revision: 938018
URL: http://svn.apache.org/viewvc?rev=938018&view=rev
Log:
First cut of executecommand unix shell script.
Added:
incubator/lcf/trunk/modules/framework/scripts/executecommand.sh
Added: incubator/lcf/trunk/modules/framework/scripts/executecommand.sh
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/scripts/executecommand.sh?rev=938018&view=auto
==============================================================================
--- incubator/lcf/trunk/modules/framework/scripts/executecommand.sh (added)
+++ incubator/lcf/trunk/modules/framework/scripts/executecommand.sh Mon Apr 26 12:28:14 2010
@@ -0,0 +1,35 @@
+#!/bin/bash -e
+
+#Make sure environment variables are properly set
+if [ -e $JAVA_HOME/bin/java ] ; then
+ if [ -f $LCF_HOME/properties.ini ] ; then
+
+ # Build the classpath
+ CLASSPATH=""
+ for filename in $(ls -1 "$LCF_HOME/processes/jar") ; do
+ if [ -n "$CLASSPATH" ] ; then
+ CLASSPATH="$CLASSPATH":"$LCF_HOME"/processes/jar/"$filename"
+ else
+ CLASSPATH="$LCF_HOME"/processes/jar/"$filename"
+ fi
+ done
+
+ # Build the defines
+ DEFINES=""
+ for filename in $(ls -1 "$LCF_HOME/processes/define") ; do
+ DEFINEVAR=-D"$filename"=$(cat "$LCF_HOME/processes/define/"$filename")
+ DEFINES="$DEFINES $DEFINEVAR"
+ done
+
+ "$JAVA_HOME/bin/java" "$DEFINES" --classpath "$CLASSPATH" "$@"
+ exit $?
+
+ else
+ echo "Environment variable LCF_HOME is not properly set." 1>&2
+ exit 1
+ fi
+
+else
+ echo "Environment variable JAVA_HOME is not properly set." 1>&2
+ exit 1
+fi