Package: netdiag
Version: 1.0-20

        Contrary to what's stated in debian/templates,
        /etc/default/netdiag /shouldn't/ be edited directly to change
        the run_statnetd value, as it will be overwritten by the value
        of the netdiag/run_statnetd Debconf question the next time the
        package is (re)configured.

        Instead, it should suggest that # dpkg-reconfigure netdiag is
        run (see the untested patch MIME'd.)

        Also to note is that the postinst script (unnecessarily, as it
        seems) passes each of the RE's to grep(1) twice:

--cut--
            printf "$default_format" '.*' '.*' \
                | grep -vxf - /etc/default/netdiag \
--cut--

        It'd be nice for /etc/default/netdiag to state prominently that
        it isn't a Debian conffile and that it's expected to be
        overwritten at package upgrades, etc.  Like, e. g. (as inspired
        by /etc/exim4/update-exim4.conf.conf):

# Please note that this is _not_ a dpkg-conffile and that automatic
# changes to this file might happen.  In particular, use
#     # dpkg-reconfigure netdiag
# to change the run_statnetd value, as it's likely to be overwritten
# otherwise.

        TIA.

-- 
FSF associate member #7257
--- debian/templates.~1~
+++ debian/templates	2012-10-18 13:18:06.000000000 +0000
@@ -3,5 +3,5 @@
 Default: true
 _Description: Start statnetd at boot time?
  Please specify whether statnetd should be started as part of the boot
- process. This can be changed later by editing /etc/default/netdiag.
+ process.  This can be changed later by running dpkg-reconfigure netdiag.
 
--- postinst.~1~
+++ postinst	2012-10-18 13:31:25.000000000 +0000
@@ -6,6 +6,11 @@
     . /usr/share/debconf/confmodule
 
     default_format="\
+# Please note that this is _not_ a dpkg-conffile and that automatic
+# changes to this file might happen.  In particular, use
+#     # dpkg-reconfigure netdiag
+# to change the run_statnetd value, as it's likely to be overwritten
+# otherwise.
 # Start statnetd at boot time? 0 or 1
 run_statnetd=%s
 # Specify additional statnetd options here (see manpage).
@@ -24,7 +29,7 @@
 	# and $run_statnetd.
 	if [ -f /etc/default/netdiag ]
 	then
-	    printf "$default_format" '.*' '.*' \
+	    printf "$default_format" '.*' \
 		| grep -vxf - /etc/default/netdiag \
 		| grep -v statnetd_options || true
 	fi

Reply via email to