orig/tradinstall.csh
author Axel Jacobs <axel@jaloxa.eu>
Mon, 14 Apr 2014 22:21:17 +0100
changeset 73 87fa3132a136
parent 0 0aa115157c9c
permissions -rw-r--r--
New IES test file with spaces in file name
axel@0
     1
#!/bin/csh -fe
axel@0
     2
# RCSid: $Id: tradinstall.csh,v 2.7 2003/02/22 02:07:30 greg Exp $
axel@0
     3
# Install correct version of trad for wish or wish4.0
axel@0
     4
#
axel@0
     5
set instdir = $1
axel@0
     6
set libdir = $2
axel@0
     7
axel@0
     8
set TLIBFILES = ( *[a-z].tcl *.hlp trad.icon tclIndex )
axel@0
     9
axel@0
    10
set TDIFFS = (`ls | sed -n 's/3\.6\.tcl$//p'`)
axel@0
    11
axel@0
    12
set WISHCOMS = ( wish4.{3,2,1,0} wish8.0 wish )
axel@0
    13
axel@0
    14
foreach w ( $WISHCOMS )
axel@0
    15
	foreach d ($path)
axel@0
    16
		if (-x $d/$w) then
axel@0
    17
			set wishcom = $d/$w
axel@0
    18
			break
axel@0
    19
		endif
axel@0
    20
	end
axel@0
    21
	if ( $?wishcom ) break
axel@0
    22
end
axel@0
    23
if (! $?wishcom) then
axel@0
    24
	echo "Cannot find wish executable in current path -- trad not installed."
axel@0
    25
	exit 1
axel@0
    26
endif
axel@0
    27
# if ( $wishcom:t == wish ) then
axel@0
    28
#	set wishcom="$wishcom -f"
axel@0
    29
#	set oldwish
axel@0
    30
# endif
axel@0
    31
axel@0
    32
echo "Installing trad using $wishcom"
axel@0
    33
axel@0
    34
sed -e "1s|/usr/local/bin/wish4\.0|$wishcom|" \
axel@0
    35
	-e "s|^set radlib .*|set radlib $libdir|" trad.wsh > $instdir/trad
axel@0
    36
chmod 755 $instdir/trad
axel@0
    37
if (! -d $libdir) then
axel@0
    38
	mkdir $libdir
axel@0
    39
endif
axel@0
    40
(cd $libdir ; rm -f $TLIBFILES)
axel@0
    41
cp $TLIBFILES $libdir
axel@0
    42
if ($?oldwish) then
axel@0
    43
	foreach i ($TDIFFS)
axel@0
    44
		rm -f $libdir/$i.tcl
axel@0
    45
		cp ${i}3.6.tcl $libdir/$i.tcl
axel@0
    46
	end
axel@0
    47
endif