1 #! /bin/sh 2 3 4 program="$0" 5 6 # Follow symlinks until we get to the actual file. 7 while [ -h "$program" ]; do 8 link=`ls -ld "$program"` 9 link=`expr "$link" : '.*-> \(.*\)'` 10 if [ "`expr "$link" : '/.*'`" = 0 ]; then 11 # Relative 12 dir=`dirname "$program"` 13 program="$dir/$link" 14 else 15 # Absolute 16 program="$link" 17 fi 18 done 19 20 # Assume findbugs home directory is the parent 21 # of the directory containing the script (which should 22 # normally be "$findbugs_home/bin"). 23 dir=`dirname "$program"` 24 findbugs_home="$dir/.." 25 26 # Handle FHS-compliant installations (e.g., Fink) 27 if [ -d "$findbugs_home/share/findbugs" ]; then 28 findbugs_home="$findbugs_home/share/findbugs" 29 fi 30 31 # Make absolute 32 findbugs_home=`cd "$findbugs_home" && pwd` 33 34 fb_pathsep=':' 35 36 # Handle cygwin, courtesy of Peter D. Stout 37 fb_osname=`uname` 38 if [ `expr "$fb_osname" : CYGWIN` -ne 0 ]; then 39 findbugs_home=`cygpath --mixed "$findbugs_home"` 40 fb_pathsep=';' 41 fi 42 # Handle MKS, courtesy of Kelly O'Hair 43 if [ "${fb_osname}" = "Windows_NT" ]; then 44 fb_pathsep=';' 45 fi 46 47 if [ ! -d "$findbugs_home" ]; then 48 echo "The path $findbugs_home," 49 echo "which is where I think FindBugs is located," 50 echo "does not seem to be a directory." 51 exit 1 52 fi 53 54 # Choose default java binary 55 fb_javacmd=java 56 if [ ! -z "$JAVA_HOME" ] && [ -x "$JAVA_HOME/bin/java" ]; then 57 if [ `expr "$fb_osname" : CYGWIN` -ne 0 ]; then 58 fb_javacmd=`cygpath --mixed "$JAVA_HOME"`/bin/java 59 else 60 fb_javacmd="$JAVA_HOME/bin/java" 61 fi 62 fi 63 64 fb_mainclass=edu.umd.cs.findbugs.cloud.db.DBStats 65 66 fb_javacmd=${fb_javacmd:-"java"} 67 fb_maxheap=${fb_maxheap:-"-Xmx768m"} 68 fb_appjar=${fb_appjar:-"$findbugs_home/lib/findbugs.jar"} 69 set -f 70 #echo command: \ 71 exec "$fb_javacmd" \ 72 -classpath "$fb_appjar$fb_pathsep$CLASSPATH" \ 73 -Dfindbugs.home="$findbugs_home"\ 74 $fb_maxheap $fb_jvmargs $fb_mainclass ${@:+"$@"} $fb_appargs 75 76 # vim:ts=3 77