3
# Config script for CVS using debconf
4
. /usr/share/debconf/confmodule
5
db_version 2.0 || [ $? -lt 30 ]
7
# Guard, since it's possible that we can have illegal constructs like
8
# ROT__tmp_cvs-test=false
11
if [ -f /etc/cvs-pserver.conf ]; then
12
. /etc/cvs-pserver.conf || true
15
if [ -f /etc/cvs-cron.conf ]; then
20
# This function reads the current configuration from the config file
21
# (or rather, the variables sourced above)
25
db_set cvs/repositories "$REPOS" || true
27
if [ "$ROT_HIST" ]; then
28
db_set cvs/rotatehistory "$ROT_HIST" || true
29
if [ "$ROT_HIST" = "individual" -a -f /etc/cvs-cron.conf ]; then
30
for rep in `grep "^ROT__" /etc/cvs-cron.conf`; do
31
key=`echo $rep| sed -e 's,^ROT_,,g' -e 's,=.*,,g'`
32
value=`echo $rep| sed -e 's,.*=,,g'`
33
db_set cvs/rotate/$key $value || true
37
if [ "$ROTKEEP" ]; then
38
db_set cvs/rotatekeep_nondefault "$ROTKEEP" || true
39
if [ "$ROTKEEP" = "individual" ]; then
41
for rep in `grep "^ROTKEEP_" /etc/cvs-cron.conf`; do
42
key=`echo $rep| sed -e 's,^ROTKEEP_,,g' -e 's,=.*,,g'`
43
value=`echo $rep| sed -e 's,.*=,,g'`
44
db_set cvs/rotatekeep/$key $value || true
49
if [ "$CVS_PSERV_RESPAWN" ]; then
50
db_set cvs/pserver_spawnlimit "$CVS_PSERV_RESPAWN" || true
52
if [ "$CVS_ENAB_PSERV" ]; then
53
CVS_ENAB_PSERV=`echo "$ENAB_PSERV" | tr A-Z a-z`
54
if [ "$CVS_ENAB_PSERV" = "yes" ]; then
55
db_set cvs/pserver true || true
57
db_set cvs/pserver false || true
60
if [ "$OTHER_ROTKEEP" ]; then
61
db_set cvs/rotatekeep "$OTHER_ROTKEEP" || true
63
if [ "$CVS_PSERV_REPOS" = "$REPOS" ]; then
64
db_set cvs/pserver_repos all || true
65
elif [ "$CVS_PSERV_REPOS" ]; then
66
db_set cvs/pserver_repos some || true
67
for rep in `echo $REPOS | sed 's,:, ,g'`; do
69
key=`echo $rep | sed 's,/,_,g'`
70
for pservrep in `echo $CVS_PSERV_REPOS | sed 's,:, ,'g`; do
71
if [ "$rep" = "$pservrep" ]; then
74
db_set cvs/pserver/$key true || true
77
if [ "$found" = "0" ]; then
78
db_set cvs/pserver/$key false || true
84
# Get the repositories list.
88
while [ $OK -eq 0 ]; do
89
db_input medium cvs/repositories ||:
91
db_get cvs/repositories
96
if [ ! -d "$i" ]; then
97
if [ ! -z "$BAD" ]; then
99
BADDESC="$BADDESC, $i"
108
if [ ! -z "$BAD" ]; then
110
db_subst cvs/badrepositories badreps "$BADDESC"
111
db_input medium cvs/badrepositories || if [ $? -eq 30 ]; then
115
db_get cvs/badrepositories
116
if [ "$RET" = "reenter" -a $IGNORE -eq 0 ]; then
117
db_fset cvs/repositories seen false
131
# Get history rotation information.
134
db_get cvs/repositories
136
if [ -z "$REPOS" ]; then
139
db_input low cvs/rotatehistory ||:
141
db_get cvs/rotatehistory
143
if [ x"$ROTHIST" = x"yes" -o x"$ROTHIST" = x"individual" ]; then
144
db_input low cvs/rotatekeep_nondefault ||:
147
db_set cvs/rotatekeep_nondefault no
148
db_fset cvs/rotatekeep_nondefault seen false
150
db_get cvs/rotatekeep_nondefault
152
if [ x"$ROTHIST" = x"individual" -o x"$ROTHIST" = x"yes" -a x"$ROTKEEP" = x"individual" ]; then
158
RNAME="`echo "$i" | sed -e 's:/:_:g'`"
160
if [ x"$ROTHIST" = x"individual" ]; then
161
db_register cvs/rotate_individual "cvs/rotate/$RNAME"
162
db_subst "cvs/rotate/$RNAME" repos "$i"
163
db_input medium "cvs/rotate/$RNAME" ||:
173
RNAME="`echo "$i" | sed -e 's:/:_:g'`"
175
if [ x"$ROTHIST" = x"individual" ]; then
176
db_get "cvs/rotate/$RNAME"
177
if [ x"$RET" = x"false" ]; then
181
if [ "$ROTKEEP" = "individual" -a $DO_RK -eq 1 ]; then
182
db_register cvs/rotatekeep_individual "cvs/rotatekeep/$RNAME"
183
db_subst "cvs/rotatekeep/$RNAME" repos "$i"
184
db_input medium "cvs/rotatekeep/$RNAME" ||:
192
# Set up the pserver.
195
db_get cvs/repositories
197
if [ -z "$REPOS" ]; then
200
db_input medium cvs/pserver ||:
203
if [ "$RET" = "true" ]; then
204
db_input low cvs/pserver_repos ||:
206
db_get cvs/pserver_repos
207
if [ "$RET" = "some" ]; then
209
db_get cvs/repositories
215
RNAME="`echo "$i" | sed -e 's:/:_:g'`"
216
db_register cvs/pserver_repos_individual "cvs/pserver/$RNAME"
217
db_subst "cvs/pserver/$RNAME" repos "$i"
218
db_input medium "cvs/pserver/$RNAME" ||:
223
db_input low cvs/pserver_setspawnlimit ||:
225
db_get cvs/pserver_setspawnlimit
226
if [ "$RET" = "true" ]; then
227
db_input low cvs/pserver_spawnlimit ||:
233
# Import old settings from cvs.conf.
236
if [ -f /etc/cvs.conf ]; then
239
if [ -f /etc/cvs.conf.import ]; then
240
. /etc/cvs.conf.import
242
db_set cvs/repositories "$CVS_REPOS"
243
if [ x"$CVS_ROTATE" = x"no" ]; then
244
db_set cvs/rotatehistory no
246
if [ x"$CVS_ROTDIRS" != x"$CVS_REPOS" ]; then
247
db_set cvs/rotatehistory individual
249
for i in $CVS_REPOS; do
252
RNAME="`echo "$i" | sed -e 's:/:_:g'`"
253
db_register cvs/rotate_individual "cvs/rotate/$RNAME"
254
db_subst "cvs/rotate/$RNAME" repos "$i"
255
db_set "cvs/rotate/$RNAME" false
258
for i in $CVS_ROTDIRS; do
261
RNAME="`echo "$i" | sed -e 's:/:_:g'`"
262
db_set "cvs/rotate/$RNAME" true
265
db_set cvs/rotatehistory yes
267
if [ x"$CVS_ROTATE" = x"yes" ]; then
268
db_set cvs/rotatekeep_nondefault no
270
db_set cvs/rotatekeep_nondefault individual
278
for i in $CVS_ROTATE; do
279
if [ x"$i" != x"$LAST" -a x"$i" != x"" ]; then
283
if [ $SAME -eq 1 ]; then
284
if [ x"$LAST" != x"n" ]; then
285
db_set cvs/rotatekeep_nondefault yes
286
db_set cvs/rotatekeep "$LAST"
288
db_set cvs/rotatekeep_nondefault no
291
for i in $CVS_ROTATE; do
293
DIR="`echo $DIRS | sed 's/\([^:]*\):.*/\1/'`"
294
DIRS="`echo $DIRS | sed 's/[^:]*:\(.*\)/\1/'`"
295
RNAME="`echo "$DIR" | sed -e 's:/:_:g'`"
296
db_register cvs/rotatekeep_individual "cvs/rotatekeep/$RNAME"
297
db_subst "cvs/rotatekeep/$RNAME" repos "$DIR"
300
db_set "cvs/rotate/$RNAME" false
304
db_set "cvs/rotatekeep/$RNAME" $i
311
if [ x"$CVS_ENAB_PSERV" = x"yes" ]; then
312
db_set cvs/pserver true
313
if [ x"$CVS_PSERV_REPOS" != x"$CVS_REPOS" ]; then
314
db_set cvs/pserver_repos some
316
for i in $CVS_REPOS; do
319
RNAME="`echo "$i" | sed -e 's:/:_:g'`"
320
db_register cvs/pserver_repos_individual "cvs/pserver/$RNAME"
321
db_subst "cvs/pserver/$RNAME" repos "$i"
322
db_set "cvs/pserver/$RNAME" false
325
for i in $CVS_PSERV_REPOS; do
328
RNAME="`echo "$i" | sed -e 's:/:_:g'`"
329
db_set "cvs/pserver/$RNAME" true
332
db_set cvs/pserver_repos all
334
if [ $CVSCONF_VERSION -ge 2 ]; then
335
if [ "$CVS_PSERV_RESPAWN" != "off" -a
336
"$CVS_PSERV_RESPAWN" != "off-def" ]; then
337
db_set cvs/pserver_setspawnlimit true
338
db_set cvs/pserver_spawnlimit "$CVS_PSERV_RESPAWN"
340
db_set cvs/pserver_setspawnlimit false
343
db_set cvs/pserver_setspawnlimit false
346
db_set cvs/pserver false
348
if [ -f /etc/cvs.conf.import ]; then
349
rm -f /etc/cvs.conf.import
355
# Check if we need to import the old /etc/cvs.conf
356
if [ -f /etc/cvs.conf -o -f /etc/cvs.conf.import ]; then
358
if [ -f /etc/cvs.conf ]; then
359
mv /etc/cvs.conf /etc/cvs.conf.dpkg-old