Mercurial > noffle
changeset 360:a23b37308063 noffle
[svn] || true cleanup
author | godisch |
---|---|
date | Sat, 29 Mar 2003 06:57:20 +0000 |
parents | d1007cf6a49c |
children | dec92f910289 |
files | debian/config debian/postinst debian/prerm |
diffstat | 3 files changed, 30 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/debian/config Fri Mar 28 22:17:33 2003 +0000 +++ b/debian/config Sat Mar 29 06:57:20 2003 +0000 @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: config 497 2003-03-28 22:17:33Z godisch $ +# $Id: config 499 2003-03-29 06:57:20Z godisch $ set -e . /usr/share/debconf/confmodule @@ -23,6 +23,7 @@ db_input high noffle/debconf && db_go || : db_get noffle/debconf if [ "$RET" = false ]; then + db_stop exit 0 fi @@ -30,49 +31,49 @@ port="`grep '[[:space:]]/usr/bin/noffle[[:space:]]' /etc/inetd.conf | head -n 1 | sed 's/^#<off># //;s/[[:space:]].*//' 2> /dev/null`" || : if [ "$port" ]; then # read port value from debconf db - db_get noffle/port || RET="" + db_get noffle/port # for upgrading from < 1.1.2 [ "$RET" = 119 ] && RET=nntp || : # we need confirmation, if they differ - [ "$port" = "$RET" ] || db_fset noffle/port seen false || : + [ "$port" = "$RET" ] || db_fset noffle/port seen false # write current port from inetd.conf into debconf db [ "$port" = "${port#\#}" ] && db_set noffle/port "$port" || : fi # read server, username, password, maxfetch, default-expire from $server_config if [ -s "$server_config" ]; then - db_get noffle/server || RET="" + db_get noffle/server server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : - [ "$server" = "$RET" ] || db_fset noffle/server seen false || : + [ "$server" = "$RET" ] || db_fset noffle/server seen false [ "$server" ] && db_set noffle/server "$server" || : - db_get noffle/username || RET="" + db_get noffle/username server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : - [ "$username" = "$RET" ] || db_fset noffle/username seen false || : + [ "$username" = "$RET" ] || db_fset noffle/username seen false [ "$username" ] && db_set noffle/username "$username" || : - db_get noffle/password || RET="" + db_get noffle/password server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : - [ "$password" = "$RET" ] || db_fset noffle/password seen false || : + [ "$password" = "$RET" ] || db_fset noffle/password seen false [ "$password" ] && db_set noffle/password "$password" || : - db_get noffle/maxfetch || RET="" + db_get noffle/maxfetch maxfetch="`grep '^max-fetch' $server_config | head -n 1 | sed 's/^max-fetch[[:space:]]*//' 2> /dev/null`" || : - [ "$maxfetch" = "$RET" ] || db_fset noffle/maxfetch seen false || : + [ "$maxfetch" = "$RET" ] || db_fset noffle/maxfetch seen false [ "$maxfetch" ] && db_set noffle/maxfetch "$maxfetch" || : - db_get noffle/default-expire || RET="" + db_get noffle/default-expire defexpire="`grep '^default-expire' $server_config | head -n 1 | sed 's/^default-expire[[:space:]]*//' 2> /dev/null`" || : - [ "$defexpire" = "$RET" ] || db_fset noffle/defexpire seen false || : + [ "$defexpire" = "$RET" ] || db_fset noffle/defexpire seen false [ "$defexpire" ] && db_set noffle/default-expire "$defexpire" || : fi # for backward compatibility < 1.1.2-1 if dpkg --compare-versions "$2" lt-nl 1.1.2; then - db_get noffle/fetchmode || RET="" + db_get noffle/fetchmode case "$RET" in - 'via dialup') db_set noffle/fetchmode ppp || :;; - 'via permanent connection') db_set noffle/fetchmode cron || :;; + 'via dialup') db_set noffle/fetchmode ppp;; + 'via permanent connection') db_set noffle/fetchmode cron;; esac fi @@ -85,8 +86,8 @@ NOFFLE_FETCHMODE=cron fi # do we need confirmation? -db_get noffle/fetchmode || RET="" -[ "$NOFFLE_FETCHMODE" = "$RET" ] || db_fset noffle/fetchmode seen false || : +db_get noffle/fetchmode +[ "$NOFFLE_FETCHMODE" = "$RET" ] || db_fset noffle/fetchmode seen false # input configuration using backup capability, see debconf-devel(8) state=1
--- a/debian/postinst Fri Mar 28 22:17:33 2003 +0000 +++ b/debian/postinst Sat Mar 29 06:57:20 2003 +0000 @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: postinst 465 2003-02-25 19:15:27Z godisch $ +# $Id: postinst 499 2003-03-29 06:57:20Z godisch $ set -e @@ -35,32 +35,32 @@ mv -f /etc/noffle.conf.old $server_config.old 2> /dev/null || : fi -db_get noffle/debconf || RET="" +db_get noffle/debconf if [ "$RET" != false ]; then - db_get noffle/port || RET="" + db_get noffle/port port="$RET" [ -z "$port" -o "$port" = 119 ] && port=nntp || : # maybe disabled only, e.g. dpkg -r noffle update-inetd --remove "/usr/bin/noffle -r" || : update-inetd --group MAIL --add "$port\tstream\ttcp\tnowait\tnews\t/usr/sbin/tcpd /usr/bin/noffle -r" - db_get noffle/server || RET="" + db_get noffle/server server="$RET" [ "$server" ] || server=news - db_get noffle/username || RET="" + db_get noffle/username username="$RET" - db_get noffle/password || RET="" + db_get noffle/password password="$RET" - db_get noffle/fetchmode || RET="" + db_get noffle/fetchmode fetchmode="$RET" [ "$fetchmode" ] || if [ -x /usr/sbin/pppd ]; then fetchmode=ppp else fetchmode=cron fi - db_get noffle/maxfetch || RET="" + db_get noffle/maxfetch maxfetch="$RET" [ "$maxfetch" ] || maxfetch="$maxfetch_default" - db_get noffle/default-expire || RET="" + db_get noffle/default-expire defexpire="$RET" [ "$defexpire" ] || defexpire="$defexpire_default" # try to be idempotent
--- a/debian/prerm Fri Mar 28 22:17:33 2003 +0000 +++ b/debian/prerm Sat Mar 29 06:57:20 2003 +0000 @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: prerm 465 2003-02-25 19:15:27Z godisch $ +# $Id: prerm 499 2003-03-29 06:57:20Z godisch $ set -e . /usr/share/debconf/confmodule @@ -12,7 +12,7 @@ fi if [ -e /usr/share/debconf/confmodule ]; then - db_get noffle/port || RET="" + db_get noffle/port port="$RET" [ -z "$port" -o "$port" = 119 ] && port=nntp || : update-inetd --disable $port