--- ray/src/util/tradinstall.csh 1995/11/07 09:58:43 2.3 +++ ray/src/util/tradinstall.csh 2019/05/01 16:47:54 2.10 @@ -1,5 +1,5 @@ #!/bin/csh -fe -# SCCSid "$SunId$ LBL" +# RCSid: $Id: tradinstall.csh,v 2.10 2019/05/01 16:47:54 greg Exp $ # Install correct version of trad for wish or wish4.0 # set instdir = $1 @@ -9,29 +9,28 @@ set TLIBFILES = ( *[a-z].tcl *.hlp trad.icon tclIndex set TDIFFS = (`ls | sed -n 's/3\.6\.tcl$//p'`) -foreach d ($path) - if (-x $d/wish4.0) then - set wishcom = $d/wish4.0 - break - endif -end -if (! $?wishcom) then +set WISHCOMS = ( wish4.{3,2,1,0} wish8.{6,5,4,3,2,1,0} wish ) + +foreach w ( $WISHCOMS ) foreach d ($path) - if (-x $d/wish) then - set wishcom = "$d/wish -f" + if (-x $d/$w) then + set wishcom = $d/$w break endif end - if (! $?wishcom) then - echo "Cannot find wish executable in current path -- trad not installed." - exit 1 - endif - set oldwish + if ( $?wishcom ) break +end +if (! $?wishcom) then + echo "Cannot find wish executable in current path -- trad not installed." + exit 1 endif +if ("`file $wishcom`" =~ "*shell script*") then + set wishcom="/bin/sh" +endif echo "Installing trad using $wishcom" -sed -e "1s|/usr/local/bin/wish4\.0|$wishcom|" \ +sed -e "1s|/usr/bin/wish|$wishcom|" \ -e "s|^set radlib .*|set radlib $libdir|" trad.wsh > $instdir/trad chmod 755 $instdir/trad if (! -d $libdir) then @@ -39,9 +38,3 @@ if (! -d $libdir) then endif (cd $libdir ; rm -f $TLIBFILES) cp $TLIBFILES $libdir -if ($?oldwish) then - foreach i ($TDIFFS) - rm -f $libdir/$i.tcl - cp ${i}3.6.tcl $libdir/$i.tcl - end -endif