1 |
|
#!/bin/csh -fe |
2 |
< |
# SCCSid "$SunId$ LBL" |
2 |
> |
# RCSid: $Id$ |
3 |
|
# Install correct version of trad for wish or wish4.0 |
4 |
|
# |
5 |
|
set instdir = $1 |
6 |
|
set libdir = $2 |
7 |
|
|
8 |
+ |
# Need to execute in containing directory: |
9 |
+ |
if ($0:h != $0) cd $0:h |
10 |
+ |
|
11 |
|
set TLIBFILES = ( *[a-z].tcl *.hlp trad.icon tclIndex ) |
12 |
|
|
13 |
|
set TDIFFS = (`ls | sed -n 's/3\.6\.tcl$//p'`) |
14 |
|
|
15 |
< |
foreach d ($path) |
16 |
< |
if (-x $d/wish4.0) then |
17 |
< |
set wishcom = $d/wish4.0 |
15 |
< |
break |
16 |
< |
endif |
17 |
< |
end |
18 |
< |
if (! $?wishcom) then |
15 |
> |
set WISHCOMS = ( wish4.{3,2,1,0} wish8.{6,5,4,3,2,1,0} wish ) |
16 |
> |
|
17 |
> |
foreach w ( $WISHCOMS ) |
18 |
|
foreach d ($path) |
19 |
< |
if (-x $d/wish) then |
20 |
< |
set wishcom = "$d/wish -f" |
19 |
> |
if (-x $d/$w) then |
20 |
> |
set wishcom = $d/$w |
21 |
|
break |
22 |
|
endif |
23 |
|
end |
24 |
< |
if (! $?wishcom) then |
25 |
< |
echo "Cannot find wish executable in current path -- trad not installed." |
26 |
< |
exit 1 |
27 |
< |
endif |
28 |
< |
set oldwish |
24 |
> |
if ( $?wishcom ) break |
25 |
> |
end |
26 |
> |
if (! $?wishcom) then |
27 |
> |
echo "Cannot find wish executable in current path -- trad not installed." |
28 |
> |
exit 1 |
29 |
|
endif |
30 |
+ |
if ("`file $wishcom`" =~ "*shell script*") then |
31 |
+ |
set wishcom="/bin/sh" |
32 |
+ |
endif |
33 |
|
|
34 |
|
echo "Installing trad using $wishcom" |
35 |
|
|
36 |
< |
sed -e "1s|/usr/local/bin/wish4\.0|$wishcom|" \ |
36 |
> |
sed -e "1s|/usr/bin/wish|$wishcom|" \ |
37 |
|
-e "s|^set radlib .*|set radlib $libdir|" trad.wsh > $instdir/trad |
38 |
|
chmod 755 $instdir/trad |
39 |
|
if (! -d $libdir) then |
41 |
|
endif |
42 |
|
(cd $libdir ; rm -f $TLIBFILES) |
43 |
|
cp $TLIBFILES $libdir |
42 |
– |
if ($?oldwish) then |
43 |
– |
foreach i ($TDIFFS) |
44 |
– |
rm -f $libdir/$i.tcl |
45 |
– |
cp ${i}3.6.tcl $libdir/$i.tcl |
46 |
– |
end |
47 |
– |
endif |