tags 687942 + patch thanks Hi
I have prepared a patch (based/following the work already done by gregor hermann for fprobe). I have not yet uploaded the NMU to any delayed queue due the following: The previous default /etc/default/fprobe-ulog ships with INTERFACE="eth0:100" whereas the default for the debconf question is set to: Default: eth0:100,ppp0:200 This is not grave, but this should probaly also be rectified to have it consistent? (I will wait now for the upload). Regards, Salvatore
diff -u fprobe-ulog-1.1/debian/changelog fprobe-ulog-1.1/debian/changelog --- fprobe-ulog-1.1/debian/changelog +++ fprobe-ulog-1.1/debian/changelog @@ -1,3 +1,21 @@ +fprobe-ulog (1.1-7.3) unstable; urgency=low + + * Non-maintainer upload. + * Fix "modifies conffiles (policy 10.7.3): /etc/default/fprobe-ulog" + (Closes: #687942). + - Don't install /etc/default/fprobe-ulog via dh_installinit + - Read /etc/default/fprobe-ulog in fprobe-ulog.config. + Read /etc/default/fprobe-ulog into Debconf in fprobe-ulog.config + if the file exists. + - Create /etc/default/fprobe-ulog in postinst. + Create /etc/default/fprobe-ulog if it does not yet exists in + postinst. If admin furthermore deleted or commented some variables + but then set them via debconf, (re-)add them to the configuration + file in postinst. + - Remove configuration file on purge in postrm script + + -- Salvatore Bonaccorso <car...@debian.org> Mon, 08 Oct 2012 01:07:43 +0200 + fprobe-ulog (1.1-7.2) unstable; urgency=low * Non-maintainer upload. reverted: --- fprobe-ulog-1.1/debian/default +++ fprobe-ulog-1.1.orig/debian/default @@ -1,6 +0,0 @@ -#fprobe-ulog default configuration file - - -INTERFACE="eth0:100" -FLOW_COLLECTOR="localhost:2055" -OTHER_ARGS="" diff -u fprobe-ulog-1.1/debian/config fprobe-ulog-1.1/debian/config --- fprobe-ulog-1.1/debian/config +++ fprobe-ulog-1.1/debian/config @@ -7,6 +7,14 @@ # Use debconf. . /usr/share/debconf/confmodule +# Load config file, if it exists. +if [ -e /etc/default/fprobe-ulog ]; then + . /etc/default/fprobe-ulog || true + + # Store values from config file into debconf db. + db_set fprobe-ulog/interface "$INTERFACE" + db_set fprobe-ulog/collector "$FLOW_COLLECTOR" +fi db_input high fprobe-ulog/interface || true db_input high fprobe-ulog/collector || true diff -u fprobe-ulog-1.1/debian/postinst fprobe-ulog-1.1/debian/postinst --- fprobe-ulog-1.1/debian/postinst +++ fprobe-ulog-1.1/debian/postinst @@ -4,10 +4,30 @@ # Use debconf. . /usr/share/debconf/confmodule -if [ "$1" = "configure" ] && [ -z "$2" ]; then +# generate default file if it doesn't exist +if [ ! -e /etc/default/fprobe-ulog ]; then + cat > /etc/default/fprobe-ulog <<-END + #fprobe-ulog default configuration file + + + INTERFACE="eth0:100" + FLOW_COLLECTOR="localhost:2055" + OTHER_ARGS="" + END +fi + +if [ "$1" = "configure" ]; then db_get fprobe-ulog/interface && interface="$RET" db_get fprobe-ulog/collector && collector="$RET" - + + # If the admin deleted or commented some variables but then set + # them via debconf, (re-)add them to the conffile. + test -z "$interface" || grep -Eq '^ *INTERFACE=' /etc/default/fprobe-ulog || \ + echo "INTERFACE=" >> /etc/default/fprobe-ulog + test -z "$collector" || grep -Eq '^ *FLOW_COLLECTOR=' /etc/default/fprobe-ulog || \ + echo "FLOW_COLLECTOR=" >> /etc/default/fprobe-ulog + + sed -i "s/^INTERFACE=.*$/INTERFACE=\"$interface\"/" /etc/default/fprobe-ulog sed -i "s/^FLOW_COLLECTOR=.*$/FLOW_COLLECTOR=\"$collector\"/" /etc/default/fprobe-ulog fi only in patch2: unchanged: --- fprobe-ulog-1.1.orig/debian/postrm +++ fprobe-ulog-1.1/debian/postrm @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +if [ "$1" = "purge" ]; then + rm -f /etc/default/fprobe-ulog +fi + +#DEBHELPER#
signature.asc
Description: Digital signature