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