Package: sympa
Version: debian/6.0.1-1
Severity: normal
Control: tags -1 patch


Dear Debian folks,


please apply the patch from below. I also could not find the
documentation saying the parameters are required. It should also be
backported to the version in Squeeze.


Thanks,

Paul

--- 8< ---- >8 ---
Date: Fri, 26 Oct 2012 11:59:29 +0200
Subject: [PATCH] debian/postinst: Invert premise in if-statement for adding 
configuration parameters

The following commit

        commit 463789a828c8edad0438327a9233d82b2fea5c90
        Author: Stefan Hornburg (Racke) <[email protected]>
        Date:   Sun Apr 11 15:21:14 2010 +0200

            on upgrades from Sympa 5 ensure that 
bounce_warn_rate/bounce_halt_rate
            directives are set in sympa.conf

intended to add a check to `debian/postinst`, appending the parameters
`bounce_warn_rate` and `bounce_halt_rate` to `/etc/sympa/sympa.conf`
when not being found and when upgrading from Sympa 5.x.

Experiencing the problem described bug report #631162 [1], I noticed
that both parameters were added to `sympa.conf` every time I tried to
configure the package. Looking at the check, revealed that the premise
was inverted.

Additionally, both parameters were already present in my `sympa.conf`
from Sympa 5.3.4-x. But they were commented. If they need to be set, as
the commit message above suggests, then the check needs to be adapted to
add the parameters even if they are commented.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631162
---
 debian/postinst |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/postinst b/debian/postinst
index 50acc83..a7ea49b 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -94,10 +94,10 @@ rm -f "$conf"~
 if [ "$1" = "configure" ]; then
        if [ -n "$2" ] && dpkg --compare-versions "$2" lt "6.0.1"; then
                # add required parameters in Sympa 6
-               if grep -q bounce_warn_rate $conf; then
+               if ! grep -q -e '^bounce_warn_rate' $conf; then
                        echo "bounce_warn_rate 30" >> $conf;
                fi
-               if grep -q bounce_halt_rate $conf; then
+               if ! grep -q -e '^bounce_halt_rate' $conf; then
                        echo "bounce_halt_rate 50" >> $conf;
                fi
                # fix paths
-- 
1.7.10.4

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to