home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Extras / ODesign / SetupPSE.exe / data.z / osjcfp < prev    next >
Encoding:
Korn shell script  |  1997-05-01  |  1.5 KB  |  74 lines

  1. #!/bin/ksh -p
  2.  
  3. PRG=`whence $0` >/dev/null 2>&1
  4. BINDIR=`dirname $PRG`
  5. CFPHOME=`dirname $BINDIR`
  6.  
  7. OSJCFPJAVA=${OSJCFPJAVA-java}
  8.  
  9. # The shell variable acpath is assumed to be set to the name of directory
  10. # or filename.  Convert acpath to refer to a canonical name.
  11. convertacpath()
  12. {
  13.   if test -d $acpath 
  14.   then
  15.     thisdir=`pwd`
  16.     cd $acpath
  17.     acpath=`/bin/pwd`
  18.     cd $thisdir
  19.   fi
  20. }
  21.  
  22. # Convert a ':' delimited classpath list to canonical form.  The
  23. # shell variable cpath is assumed to contain the class path to convert.
  24. # Upon return, cpath refers to an updated class path
  25. convertcpath()
  26. {
  27. # We need to add a ':' at the end so that ksh parameter substitution works
  28.   tmpcpath=$cpath:
  29.   cpath=""
  30.   while [ "$tmpcpath" != "" ];do
  31. # acpath is everything up to but not including the next ':'
  32.     acpath=${tmpcpath%%:*}
  33. # tmpcpath is everything after the next ':'
  34.     tmpcpath=${tmpcpath#*:}
  35.     convertacpath
  36.     if [ "$cpath" != "" ] ; then
  37.       cpath=$cpath:$acpath
  38.     else
  39.       cpath=$acpath
  40.     fi
  41.   done
  42. }
  43.  
  44. # By default, don't canonicalize
  45. canonical=0
  46. javaargs=
  47. args=
  48. while [ "$1" != "" ];do
  49.    case "$1" in 
  50.     -canonical) canonical=1
  51.         shift
  52.         ;;
  53.     -cpath | -classpath | -d | -dest) args="$args $1"
  54.         shift
  55.         cpath=$1
  56.         shift
  57.         if [ $canonical = 1 ]; then
  58.           convertcpath
  59.         fi
  60.         args="$args $cpath"
  61.         ;;
  62.     *)      args="$args $1";shift 1 ;;
  63.    esac
  64. done
  65.  
  66. if [ $canonical = 1 ]; then
  67.   cpath=$CLASSPATH
  68.   convertcpath
  69.   CLASSPATH=$cpath
  70. fi
  71.  
  72. $OSJCFPJAVA $javaargs COM.odi.filter.OSCFP $args
  73.  
  74.