comparison debian/config @ 324:5ec39beae9c5 noffle

[svn] cleanup
author godisch
date Sat, 22 Feb 2003 21:54:34 +0000
parents 150e75d3c785
children 47ba9cbc7b75
comparison
equal deleted inserted replaced
323:67ce1ddf7313 324:5ec39beae9c5
1 #!/bin/sh 1 #!/bin/sh
2 # $Id: config 444 2003-02-19 07:36:16Z godisch $ 2 # $Id: config 459 2003-02-22 21:54:34Z godisch $
3 3
4 set -e 4 set -e
5 . /usr/share/debconf/confmodule
6 db_version 2.0
7 5
8 server_config=/etc/news/noffle.conf 6 server_config=/etc/news/noffle.conf
9 debian_config=/etc/default/noffle 7 debian_config=/etc/default/noffle
10 8
11 # for backward compatibility = 1.1.2-1, since postinst is not run yet 9 # for backward compatibility = 1.1.2-1, since postinst is not run yet
15 # for backward compatibility < 1.1.2-1 13 # for backward compatibility < 1.1.2-1
16 if [ ! -e $server_config -a ! -e $debian_config -a -e /etc/noffle/conf ]; then 14 if [ ! -e $server_config -a ! -e $debian_config -a -e /etc/noffle/conf ]; then
17 server_config=/etc/noffle/conf 15 server_config=/etc/noffle/conf
18 debian_config=/etc/noffle/conf.debian 16 debian_config=/etc/noffle/conf.debian
19 fi 17 fi
18
19 . /usr/share/debconf/confmodule
20 db_version 2.0
20 21
21 # are we using debconf? 22 # are we using debconf?
22 db_input high noffle/debconf && db_go || : 23 db_input high noffle/debconf && db_go || :
23 db_get noffle/debconf || RET="" 24 db_get noffle/debconf || RET=""
24 [ "$RET" = false ] && exit 0 25 [ "$RET" = false ] && exit 0
62 defexpire="`grep '^default-expire' $server_config | head -n 1 | sed 's/^default-expire[[:space:]]*//' 2> /dev/null`" || : 63 defexpire="`grep '^default-expire' $server_config | head -n 1 | sed 's/^default-expire[[:space:]]*//' 2> /dev/null`" || :
63 [ "$defexpire" = "$RET" ] || db_fset noffle/defexpire seen false || : 64 [ "$defexpire" = "$RET" ] || db_fset noffle/defexpire seen false || :
64 [ "$defexpire" ] && db_set noffle/default-expire "$defexpire" || : 65 [ "$defexpire" ] && db_set noffle/default-expire "$defexpire" || :
65 fi 66 fi
66 67
67 # better storing ppp/cron than 'via dialup'/'via permanent connection', 68 # for backward compatibility < 1.1.2-1
68 # since that's less language dependent in the debconf dialog
69 if dpkg --compare-versions "$2" lt-nl 1.1.2; then 69 if dpkg --compare-versions "$2" lt-nl 1.1.2; then
70 db_get noffle/fetchmode || RET="" 70 db_get noffle/fetchmode || RET=""
71 case "$RET" in 71 case "$RET" in
72 'via dialup') db_set noffle/fetchmode ppp || :;; 72 'via dialup') db_set noffle/fetchmode ppp || :;;
73 'via permanent connection') db_set noffle/fetchmode cron || :;; 73 'via permanent connection') db_set noffle/fetchmode cron || :;;
87 [ "$NOFFLE_FETCHMODE" = "$RET" ] || db_fset noffle/fetchmode seen false || : 87 [ "$NOFFLE_FETCHMODE" = "$RET" ] || db_fset noffle/fetchmode seen false || :
88 88
89 # input server port, parent server, username, password, fetchmode, maxfetch, default-expire 89 # input server port, parent server, username, password, fetchmode, maxfetch, default-expire
90 db_input low noffle/port && db_go || : 90 db_input low noffle/port && db_go || :
91 db_input high noffle/server && db_go || : 91 db_input high noffle/server && db_go || :
92 db_input medium noffle/username && db_go || : 92 db_input medium noffle/username && db_go || :
93 db_input medium noffle/password && db_go || : 93 db_input medium noffle/password && db_go || :
94 db_input medium noffle/fetchmode && db_go || : 94 db_input medium noffle/fetchmode && db_go || :
95 db_input medium noffle/maxfetch && db_go || : 95 db_input medium noffle/maxfetch && db_go || :
96 db_input low noffle/default-expire && db_go || : 96 db_input low noffle/default-expire && db_go || :
97 97
98 exit 0 98 exit 0