annotate scripts/control/install-ocst @ 5967:d542d9197839 ss-2-9-8

[project @ 2006-08-24 21:24:53 by jwe]
author jwe
date Thu, 24 Aug 2006 21:27:41 +0000
parents 46b82fca02fc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3280
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
1 #!/bin/sh
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
2 #
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
3 # install-ocst -- install/update Octave Controls Toolbox (OCST)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
4 # of A. Scottedward Hodel <A.S.Hodel@Eng.Auburn.EDU>
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
5 #
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
6 # This script uses chunks of "install-octave"
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
7 # from John W. Eaton <jwe@bevo.che.wisc.edu>
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
8 #
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
9 # Kai P Mueller <mueller@ifr.ing.tu-bs.-de>, TU Braunschweig
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
10 # 11/22/97 initial version
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
11 #
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
12
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
13 if [ $# -ne 1 ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
14 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
15 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
16 echo " usage: $0 (help | all | select)"
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
17 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
18 exit 1
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
19 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
20
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
21 case $1 in
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
22
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
23 help)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
24 cat << EOF
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
25 ==========================================================================
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
26 install-ocst attempts to install (or update) the OCST (Octave controls
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
27 toolbox) of your version of Octave.
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
28
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
29 The files in the subdirectories "general", "linear-algebra",
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
30 "strings", "plot", and "control" will be copied to the Octave data
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
31 directories with proper permissions.
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
32
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
33 If the file "obsolete.files" exists this script file fill
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
34 ask if the files listed in "obsolete.files" should be removed.
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
35
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
36 The install and update procedures differ in the way they perform the
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
37 copy of the files in this OCST version.
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
38
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
39 o all Copy all files to the Octave data directories assuming that
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
40 this version is newer. Install does not ask any questions.
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
41 This modfe is best if you are the system administrator you
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
42 just want to install the control stuff.
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
43
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
44 o select Copy all files but ask before replacing an existing file
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
45 which differs from the one in this distribution. The update
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
46 mode is appropriate for developers. New files will be
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
47 copied without confirmation.
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
48 Note: it can be very annoying to confirm the replacements.
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
49 ==========================================================================
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
50 EOF
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
51 exit 0
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
52 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
53
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
54 all)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
55 ask=no
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
56 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
57
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
58 select)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
59 ask=yes
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
60 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
61
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
62 *)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
63 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
64 echo " usage: $0 (help | all | select)"
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
65 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
66 exit 1
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
67 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
68 esac
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
69
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
70 if [ `whoami` != root ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
71 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
72 echo -n " * You should execute install-ocst as root, continue anyway? [n]: "
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
73 read ans
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
74 case "$ans" in
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
75 y | Y | yes | YES)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
76 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
77 *)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
78 exit 1
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
79 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
80 esac
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
81 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
82
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
83 # change location of the distribution file here:
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
84 ocst_version=1.2
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
85 datadir=/usr/local/share
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
86 oct_version=2.0.12
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
87
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
88 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
89 echo " - This is the OCST V$ocst_version update procedure -"
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
90
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
91 # change everything below at your own risk.
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
92 # check data directory
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
93 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
94 echo -n " * Octave data dir is $datadir/octave; is that correct? [y]: "
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
95 read ans
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
96 case "$ans" in
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
97 n | N | no | NO)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
98 echo -n " * Enter Octave data dir (without /octave/...): "
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
99 read datadir
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
100 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
101 esac
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
102 if [ ! -d "$datadir/octave" ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
103 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
104 echo "install-ocst: Octave dir ($datadir/octave) does not exist - Goodbye."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
105 exit 1
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
106 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
107
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
108 # check Octave version
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
109 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
110 echo -n " * Octave version is $oct_version; is that correct? [y]: "
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
111 read ans
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
112 case "$ans" in
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
113 n | N | no | NO)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
114 echo -n " * Enter Octave version: "
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
115 read oct_version
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
116 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
117 esac
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
118 toplevel=$datadir/octave/$oct_version/m
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
119 if [ ! -d $toplevel ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
120 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
121 echo "install-ocst: toplevel dir ($toplevel) does not exist - Goodbye."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
122 exit 1
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
123 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
124
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
125 # perform installation
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
126 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
127 echo -n " * This is your last chance to quit, continue installation? [y]: "
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
128 read ans
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
129 case "$ans" in
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
130 n | N | no | NO)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
131 echo "install-ocst aborted."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
132 exit 0
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
133 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
134 esac
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
135
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
136 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
137 distdir=`pwd`
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
138 for dd in general linear-algebra strings plot control
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
139 do
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
140 if [ -d "$dd" ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
141 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
142 echo " o installing files in $dd..."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
143 cd $dd
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
144 for ff in `ls`
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
145 do
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
146 if [ $ask = yes ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
147 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
148 if [ -e "$toplevel/$dd/$ff" ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
149 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
150 diff $ff "$toplevel/$dd/$ff" > /dev/null
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
151 if [ "$?" = 0 ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
152 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
153 # files are identical; do not copy
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
154 echo "---> $ff (same version does already exist, no replacement)"
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
155 else
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
156 # file already exit, our version is (possible) newer
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
157 echo -n " * Replace existing $ff? [y]: "
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
158 read ans
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
159 case "$ans" in
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
160 n | N | no | NO)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
161 echo "---> $ff skipped."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
162 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
163 *)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
164 cp $ff $toplevel/$dd
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
165 chmod 644 $toplevel/$dd/$ff
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
166 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
167 esac
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
168 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
169 else
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
170 echo "---> $ff (new file)"
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
171 cp $ff $toplevel/$dd
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
172 chmod 644 $toplevel/$dd/$ff
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
173 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
174 else
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
175 # copy everything without asking
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
176 cp $ff $toplevel/$dd
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
177 chmod 644 $toplevel/$dd/$ff
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
178 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
179 done
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
180 echo " ...files in $dd installed."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
181 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
182 cd $distdir
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
183 done
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
184
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
185 # check for "obsolete.files"
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
186 if [ ! -r obsolete.files ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
187 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
188 echo " o No obsolete files."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
189 else
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
190 echo " o removing obsolete files..."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
191 flist=`cat obsolete.files`
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
192 for ff in $flist
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
193 do
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
194 dfile=$toplevel/$ff
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
195 if [ ! -e "$dfile" ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
196 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
197 echo " * no obsolete file: $ff"
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
198 else
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
199 echo -n " * remove $ff? [n]: "
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
200 read ans
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
201 case "$ans" in
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
202 y | Y | yes | YES)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
203 rm $dfile
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
204 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
205 esac
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
206 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
207 done
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
208 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
209
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
210 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
211 echo " All files have been installed. Now to the final question:"
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
212 echo
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
213
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
214 echo -n " * Replace/create ls-R file? [y]: "
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
215 read ans
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
216 case "$ans" in
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
217 n | N | no | NO)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
218 echo "--> no new ls-R file."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
219 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
220 *)
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
221 if [ -d "$datadir/libexec" ]
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
222 then
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
223 echo "install-ocst: libexec directory found."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
224 ls -LR $datadir/octave $libexecdir/octave > $datadir/octave/ls-R
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
225 else
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
226 echo "install-ocst: libexec directory not found."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
227 echo " (you can safely ingnore this message.)"
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
228 ls -LR $datadir/octave > $datadir/octave/ls-R
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
229 fi
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
230 ;;
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
231 esac
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
232
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
233 echo "Thank you for using install-ocst."
46b82fca02fc [project @ 1999-10-12 17:04:44 by jwe]
jwe
parents:
diff changeset
234 exit 0