1 |
greg |
2.3 |
#!/bin/csh -fe |
2 |
greg |
2.9 |
# RCSid: $Id: tradinstall.csh,v 2.8 2011/10/26 20:06:17 greg Exp $ |
3 |
greg |
2.1 |
# Install correct version of trad for wish or wish4.0 |
4 |
|
|
# |
5 |
|
|
set instdir = $1 |
6 |
|
|
set libdir = $2 |
7 |
|
|
|
8 |
greg |
2.2 |
set TLIBFILES = ( *[a-z].tcl *.hlp trad.icon tclIndex ) |
9 |
greg |
2.1 |
|
10 |
|
|
set TDIFFS = (`ls | sed -n 's/3\.6\.tcl$//p'`) |
11 |
|
|
|
12 |
greg |
2.9 |
set WISHCOMS = ( wish4.{3,2,1,0} wish8.{6,5,4,3,2,1,0} wish ) |
13 |
greg |
2.4 |
|
14 |
|
|
foreach w ( $WISHCOMS ) |
15 |
greg |
2.1 |
foreach d ($path) |
16 |
greg |
2.4 |
if (-x $d/$w) then |
17 |
|
|
set wishcom = $d/$w |
18 |
greg |
2.1 |
break |
19 |
|
|
endif |
20 |
|
|
end |
21 |
greg |
2.4 |
if ( $?wishcom ) break |
22 |
|
|
end |
23 |
|
|
if (! $?wishcom) then |
24 |
|
|
echo "Cannot find wish executable in current path -- trad not installed." |
25 |
|
|
exit 1 |
26 |
greg |
2.1 |
endif |
27 |
greg |
2.8 |
if ("`file $wishcom`" =~ "*shell script*") then |
28 |
|
|
set wishcom="/bin/sh" |
29 |
|
|
endif |
30 |
greg |
2.1 |
|
31 |
|
|
echo "Installing trad using $wishcom" |
32 |
|
|
|
33 |
greg |
2.2 |
sed -e "1s|/usr/local/bin/wish4\.0|$wishcom|" \ |
34 |
greg |
2.1 |
-e "s|^set radlib .*|set radlib $libdir|" trad.wsh > $instdir/trad |
35 |
|
|
chmod 755 $instdir/trad |
36 |
greg |
2.3 |
if (! -d $libdir) then |
37 |
|
|
mkdir $libdir |
38 |
|
|
endif |
39 |
greg |
2.1 |
(cd $libdir ; rm -f $TLIBFILES) |
40 |
|
|
cp $TLIBFILES $libdir |