1 |
greg |
1.1 |
#!/bin/csh -f |
2 |
|
|
# RCSid $Id$ |
3 |
|
|
# |
4 |
|
|
# Install library files |
5 |
|
|
# |
6 |
|
|
again2: |
7 |
|
|
echo -n "Where do you want the library files [/usr/local/lib/ray]? " |
8 |
|
|
set ldir=$< |
9 |
|
|
(echo $ldir) >/dev/null |
10 |
|
|
if ( $status ) goto again2 |
11 |
|
|
set ldir=$ldir |
12 |
|
|
if ( "$ldir" == "" ) then |
13 |
|
|
set ldir=/usr/local/lib/ray |
14 |
|
|
else if ( "$ldir" !~ /* ) then |
15 |
|
|
echo "Directory must be relative to root, please reenter" |
16 |
|
|
goto again2 |
17 |
|
|
endif |
18 |
|
|
if ( $ldir != $cwd/lib ) then |
19 |
|
|
if ( ! -d $ldir ) then |
20 |
|
|
mkdir $ldir |
21 |
|
|
if ( $status ) then |
22 |
|
|
echo "Cannot create directory, please reenter" |
23 |
|
|
goto again2 |
24 |
|
|
endif |
25 |
|
|
endif |
26 |
|
|
set d1=(`ls -id lib`) |
27 |
|
|
set d2=(`ls -id $ldir`) |
28 |
|
|
if ($d1[1] != $d2[1]) then |
29 |
|
|
echo -n "Install library files now [n]? " |
30 |
|
|
if ( "$<" =~ [yY]* ) then |
31 |
|
|
echo -n "Copying library files to $ldir... " |
32 |
|
|
(cd lib ; tar -cf - *) | (cd $ldir ; tar -xf -) |
33 |
|
|
echo "Done." |
34 |
|
|
endif |
35 |
|
|
endif |
36 |
|
|
unset d1 d2 |
37 |
|
|
endif |