comparison debian/postinst @ 457:1420216cd450 noffle

[svn] improved ucf transition
author godisch
date Sun, 29 Jun 2003 08:22:59 +0100
parents 57fc18375ad6
children fb5e1ef118eb
comparison
equal deleted inserted replaced
456:7e0c7dd29d53 457:1420216cd450
1 #!/bin/sh 1 #!/bin/sh
2 # $Id: postinst 598 2003-06-25 16:58:46Z godisch $ 2 # $Id: postinst 601 2003-06-29 07:22:59Z godisch $
3 3
4 set -e 4 set -e
5 5
6 [ "$1" = configure ] || exit 0 6 [ "$1" = configure ] || exit 0
7 7
39 sed "s/^server[[:space:]].*/server $server $username $password/" | \ 39 sed "s/^server[[:space:]].*/server $server $username $password/" | \
40 sed "s/^max-fetch[[:space:]].*/max-fetch $maxfetch/" | \ 40 sed "s/^max-fetch[[:space:]].*/max-fetch $maxfetch/" | \
41 sed "s/^default-expire[[:space:]].*/default-expire $defexpire/" \ 41 sed "s/^default-expire[[:space:]].*/default-expire $defexpire/" \
42 > /etc/news/noffle.conf.new 42 > /etc/news/noffle.conf.new
43 chgrp news /etc/news/noffle.conf.new 43 chgrp news /etc/news/noffle.conf.new
44 ucf --three-way /etc/news/noffle.conf.new /etc/news/noffle.conf < /dev/tty 44 if cmp -s /etc/news/noffle.conf /etc/news/noffle.conf.new; then
45 UCF_FORCE_CONFFNEW=YES ucf /etc/news/noffle.conf.new /etc/news/noffle.conf < /dev/tty
46 else
47 ucf /etc/news/noffle.conf.new /etc/news/noffle.conf < /dev/tty
48 fi
45 rm -f /etc/news/noffle.conf.new 49 rm -f /etc/news/noffle.conf.new
46 50
47 umask 022 51 umask 022
48 cat /usr/share/noffle/conf.debian | \ 52 cat /usr/share/noffle/conf.debian | \
49 sed "s/^NOFFLE_FETCHMODE=.*/NOFFLE_FETCHMODE=$fetchmode/" \ 53 sed "s/^NOFFLE_FETCHMODE=.*/NOFFLE_FETCHMODE=$fetchmode/" \
50 > /etc/default/noffle.new 54 > /etc/default/noffle.new
51 ucf --three-way /etc/default/noffle.new /etc/default/noffle < /dev/tty 55 if cmp -s /etc/default/noffle /etc/default/noffle.new; then
56 UCF_FORCE_CONFFNEW=YES ucf /etc/default/noffle.new /etc/default/noffle < /dev/tty
57 else
58 ucf /etc/default/noffle.new /etc/default/noffle < /dev/tty
59 fi
52 rm -f /etc/default/noffle.new 60 rm -f /etc/default/noffle.new
53 61
54 db_get noffle/port 62 db_get noffle/port
55 port="$RET" 63 port="$RET"
56 if [ -z "$port" -o "$port" = 119 ]; then 64 if [ -z "$port" -o "$port" = 119 ]; then
59 update-inetd --remove "/usr/bin/noffle -r" 67 update-inetd --remove "/usr/bin/noffle -r"
60 update-inetd --group MAIL --add "$port\tstream\ttcp\tnowait\tnews\t/usr/sbin/tcpd /usr/bin/noffle -r" 68 update-inetd --group MAIL --add "$port\tstream\ttcp\tnowait\tnews\t/usr/sbin/tcpd /usr/bin/noffle -r"
61 69
62 db_stop 70 db_stop
63 else 71 else
64 ucf --three-way /usr/share/noffle/noffle.conf /etc/news/noffle.conf < /dev/tty 72 if cmp -s /etc/news/noffle.conf /usr/share/noffle/noffle.conf; then
65 ucf --three-way /usr/share/noffle/conf.debian /etc/default/noffle < /dev/tty 73 UCF_FORCE_CONFFNEW=YES ucf /usr/share/noffle/noffle.conf /etc/news/noffle.conf < /dev/tty
74 else
75 ucf /usr/share/noffle/noffle.conf /etc/news/noffle.conf < /dev/tty
76 fi
77 if cmp -s /etc/default/noffle /usr/share/noffle/conf.debian; then
78 UCF_FORCE_CONFFNEW=YES ucf /usr/share/noffle/conf.debian /etc/default/noffle < /dev/tty
79 else
80 ucf /usr/share/noffle/conf.debian /etc/default/noffle < /dev/tty
81 fi
66 port="`grep "/usr/bin/noffle -r" /etc/inetd.conf 2> /dev/null | sed 's/[[:space:]].*$//'`" || true 82 port="`grep "/usr/bin/noffle -r" /etc/inetd.conf 2> /dev/null | sed 's/[[:space:]].*$//'`" || true
67 if [ "$port" ]; then 83 if [ "$port" ]; then
68 update-inetd --enable "$port" 84 update-inetd --enable "$port"
69 else 85 else
70 update-inetd --group MAIL --add "nntp\tstream\ttcp\tnowait\tnews\t/usr/sbin/tcpd /usr/bin/noffle -r" 86 update-inetd --group MAIL --add "nntp\tstream\ttcp\tnowait\tnews\t/usr/sbin/tcpd /usr/bin/noffle -r"