The attachments I sent along with this note have apparently been
infected with some sort of virus...I created them on my machine at work
and scp'ed them to my Linux box here, so I didn't notice until the
auto-replies started coming in.

I'm sorry, and in case you were wary (or lucky) enough to avoid opening
them, here are new, clean versions...sorry.

Anyway, enjoy.

John




#! /bin/bash

#   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
#   reserved.


#   Adapted from the ant script in $ANT_HOME/bin 

# load system-wide jelly configuration
if [ -f "/etc/jelly.conf" ] ; then 
  . /etc/jelly.conf
fi

# provide default values for people who don't use RPMs
if [ -z "$rpm_mode" ] ; then
  rpm_mode=false;
fi
if [ -z "$usejikes" ] ; then
  usejikes=false;
fi

# load user jelly configuration
if [ -f "$HOME/.jellyrc" ] ; then 
  . $HOME/.jellyrc
fi

# OS specific support.  $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" in
  CYGWIN*) cygwin=true ;;
  Darwin*) darwin=true
           if [ -z "$JAVA_HOME" ] ; then
             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home   
           fi
           ;;
esac

if [ -z "$JELLY_HOME" ] ; then
  # try to find JELLY
  if [ -d /opt/jelly ] ; then 
    JELLY_HOME=/opt/jelly
  fi

  if [ -d ${HOME}/opt/jelly ] ; then 
    JELLY_HOME=${HOME}/opt/jelly
  fi

  ## resolve links - $0 may be a link to jelly's home
  PRG=$0
  progname=`basename $0`
  saveddir=`pwd`

  # need this for relative symlinks
  cd `dirname $PRG`
  
  while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '.*/.*' > /dev/null; then
	PRG="$link"
    else
	PRG="`dirname $PRG`/$link"
    fi
  done
  
  JELLY_HOME=`dirname "$PRG"`/..

  # make it fully qualified
  JELLY_HOME=`cd "$JELLY_HOME" && pwd`

  cd $saveddir
fi

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
  [ -n "$JELLY_HOME" ] &&
    JELLY_HOME=`cygpath --unix "$JELLY_HOME"`
  [ -n "$JAVA_HOME" ] &&
    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  [ -n "$CLASSPATH" ] &&
    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi

if [ -z "$JAVACMD" ] ; then 
  if [ -n "$JAVA_HOME"  ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 
      # IBM's JDK on AIX uses strange locations for the executables
      JAVACMD="$JAVA_HOME/jre/sh/java"
    else
      JAVACMD="$JAVA_HOME/bin/java"
    fi
  else
    JAVACMD=java
  fi
fi
 
if [ ! -x "$JAVACMD" ] ; then
  echo "Error: JAVA_HOME is not defined correctly."
  echo "  We cannot execute $JAVACMD"
  exit 1
fi

if [ -n "$JAVA_HOME" ] ; then
  # OSX hack to make Ant work with jikes
  if $darwin ; then
    OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
    if [ -d ${OSXHACK} ] ; then
      for i in ${OSXHACK}/*.jar
      do
        JIKESPATH=$JIKESPATH:$i
      done
    fi
  fi
else
  echo "Warning: JAVA_HOME environment variable is not set."
  echo "  If build fails because sun.* classes could not be found"
  echo "  you will need to set the JAVA_HOME environment variable"
  echo "  to the installation directory of java."
fi

# supply JIKESPATH to Ant as jikes.class.path
if [ -n "$JIKESPATH" ] ; then
  if $cygwin ; then
    JIKESPATH=`cygpath --path --windows "$JIKESPATH"`
  fi
  JELLY_OPTS="$JELLY_OPTS -Djikes.class.path=$JIKESPATH"
fi

# Allow Jikes support (off by default)
if $usejikes; then
  JELLY_OPTS="$JELLY_OPTS -Dbuild.compiler=jikes"
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
  JELLY_HOME=`cygpath --path --windows "$JELLY_HOME"`
  JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
  LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
  JELLY_OPTS="$JELLY_OPTS -Dcygwin.user.home="`cygpath --path --windows "$HOME"`
fi

# setup the extension directories from which to pull the jars needed.
EXT_DIRS=$JELLY_HOME/lib

if [ -n "$ANT_HOME" ] ; then
  EXT_DIRS=$EXT_DIRS:$ANT_HOME/lib
fi

"$JAVACMD" -Djelly.home="${JELLY_HOME}" -Djava.ext.dirs="${EXT_DIRS}" $JELLY_OPTS org.apache.commons.jelly.Jelly $JELLY_ARGS "$@"
echo
@echo off

::   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
::   reserved.


::   Adapted from the ant script in $ANT_HOME/bin 

if exist "%HOME%\jellyrc_pre.bat" call "%HOME%\jellyrc_pre.bat"

if not "%OS%"=="Windows_NT" goto win9xStart
:winNTStart
@setlocal

:: %~dp0 is name of current script under NT
set DEFAULT_JELLY_HOME=%~dp0

:: : operator works similar to make : operator
set DEFAULT_JELLY_HOME=%DEFAULT_JELLY_HOME%\..

if "%JELLY_HOME%"=="" set JELLY_HOME=%DEFAULT_JELLY_HOME%
set DEFAULT_JELLY_HOME=

:: Need to check if we are using the 4NT shell...
if "%@eval[2+2]" == "4" goto setup4NT

:: On NT/2K grab all arguments at once
set JELLY_CMD_LINE_ARGS=%*
goto doneStart

:setup4NT
set JELLY_CMD_LINE_ARGS=%$
goto doneStart

:win9xStart
:: Slurp the command line arguments.  This loop allows for an unlimited number of 
:: agruments (up to the command line limit, anyway).

set JELLY_CMD_LINE_ARGS=

:setupArgs
if %1a==a goto doneStart
set JELLY_CMD_LINE_ARGS=%JELLY_CMD_LINE_ARGS% %1
shift
goto setupArgs

:doneStart
:: This label provides a place for the argument list loop to break out 
:: and for NT handling to skip to.

:: find JELLY_HOME
if not "%JELLY_HOME%"=="" goto checkJava

:: check for jelly in Program Files on system drive
if not exist "%SystemDrive%\Program Files\jelly" goto checkSystemDrive
set JELLY_HOME=%SystemDrive%\Program Files\jelly
goto checkJava

:checkSystemDrive
:: check for jelly in root directory of system drive
if not exist %SystemDrive%\jelly\nul goto checkCDrive
set JELLY_HOME=%SystemDrive%\jelly
goto checkJava

:checkCDrive
:: check for jelly in C:\jelly for Win9X users
if not exist C:\jelly\nul goto noAntHome
set JELLY_HOME=C:\jelly
goto checkJava

:noAntHome
echo JELLY_HOME is not set and jelly could not be located. Please set JELLY_HOME.
goto end

:checkJava
set _JAVACMD=%JAVACMD%

if "%JAVA_HOME%" == "" goto noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java
if not exist "%_JAVACMD%.exe" echo Error: "%_JAVACMD%.exe" not found - check JAVA_HOME 
&& goto end
if exist "%JAVA_HOME%\lib\tools.jar" call "%JELLY_HOME%\bin\lcp.bat" 
%JAVA_HOME%\lib\tools.jar
if exist "%JAVA_HOME%\lib\classes.zip" call "%JELLY_HOME%\bin\lcp.bat" 
%JAVA_HOME%\lib\classes.zip
goto checkJikes

:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java
echo.
echo Warning: JAVA_HOME environment variable is not set.
echo   If build fails because sun.* classes could not be found
echo   you will need to set the JAVA_HOME environment variable
echo   to the installation directory of java.
echo.

:checkJikes
if not "%JIKESPATH%" == "" goto runAntWithJikes

:runAnt
"%_JAVACMD%" -Djelly.home="%JELLY_HOME%" -Djava.ext.dirs="%JELLY_HOME%\lib" 
%JELLY_OPTS% org.apache.commons.jelly.Jelly %JELLY_ARGS% %JELLY_CMD_LINE_ARGS%
goto end

:runAntWithJikes
"%_JAVACMD%" -Djelly.home="%JELLY_HOME%" -Djava.ext.dirs="%JELLY_HOME%\lib" 
-Djikes.class.path="%JIKESPATH%" %JELLY_OPTS% org.apache.commons.jelly.Jelly 
%JELLY_ARGS% %JELLY_CMD_LINE_ARGS%

:end
set _JAVACMD=
set JELLY_CMD_LINE_ARGS=

if not "%OS%"=="Windows_NT" goto mainEnd
:winNTend
@endlocal

:mainEnd
if exist "%HOME%\jellyrc_post.bat" call "%HOME%\jellyrc_post.bat"
echo


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to