1 |
greg |
2.1 |
#!/bin/csh -f |
2 |
|
|
# SCCSid "$SunId$ LBL" |
3 |
|
|
# 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 |
|
|
foreach d ($path) |
13 |
|
|
if (-x $d/wish4.0) then |
14 |
|
|
set wishcom = $d/wish4.0 |
15 |
|
|
break |
16 |
|
|
endif |
17 |
|
|
end |
18 |
|
|
if (! $?wishcom) then |
19 |
|
|
foreach d ($path) |
20 |
|
|
if (-x $d/wish) then |
21 |
greg |
2.2 |
set wishcom = "$d/wish -f" |
22 |
greg |
2.1 |
break |
23 |
|
|
endif |
24 |
|
|
end |
25 |
|
|
if (! $?wishcom) then |
26 |
|
|
echo "Cannot find wish executable in current path -- trad not installed." |
27 |
|
|
exit 1 |
28 |
|
|
endif |
29 |
|
|
set oldwish |
30 |
|
|
endif |
31 |
|
|
|
32 |
|
|
echo "Installing trad using $wishcom" |
33 |
|
|
|
34 |
greg |
2.2 |
sed -e "1s|/usr/local/bin/wish4\.0|$wishcom|" \ |
35 |
greg |
2.1 |
-e "s|^set radlib .*|set radlib $libdir|" trad.wsh > $instdir/trad |
36 |
|
|
if ($status) exit 1 |
37 |
|
|
chmod 755 $instdir/trad |
38 |
|
|
(cd $libdir ; rm -f $TLIBFILES) |
39 |
|
|
cp $TLIBFILES $libdir |
40 |
|
|
if ($?oldwish) then |
41 |
|
|
foreach i ($TDIFFS) |
42 |
|
|
(cd $libdir ; rm -f $i.tcl) |
43 |
|
|
cp ${i}3.6.tcl $libdir/$i.tcl |
44 |
|
|
end |
45 |
|
|
endif |