Bug#572154: ssmtp: fails to reinstall

2010-03-14 Thread Andrew Lee
tags 572154 +patch

Hi Anibal,

Just check statoverride database before updating it.

Patch attached from Thailand Mini-DebCamp 2010 BSP:
http://wiki.debian.org/DebianThailand/MiniDebCamp2010/BSP

Cheers,

-Andrew
diff -Nru ssmtp-2.64/debian/postinst ssmtp-2.64/debian/postinst
--- ssmtp-2.64/debian/postinst	2010-02-09 13:40:43.0 +0700
+++ ssmtp-2.64/debian/postinst	2010-03-14 16:03:18.0 +0700
@@ -53,6 +53,7 @@
 	touch /etc/ssmtp/ssmtp.conf.tmp
 	chmod 640 /etc/ssmtp/ssmtp.conf.tmp
 	chown root:mail /etc/ssmtp/ssmtp.conf.tmp
+	dpkg-statoverride --list /usr/sbin/ssmtp >/dev/null || \
 	dpkg-statoverride --update --add root mail 2755 /usr/sbin/ssmtp
 
 	sed "s/^root=.*/root=$root/;s/^mailhub=.*/mailhub=$mailhub/;s/^rewriteDomain=.*/rewriteDomain=$rewritedomain/;s/^hostname=.*/hostname=$hostname/;s/^FromLineOverride=.*/FromLineOverride=$FromOverride/;s/^#FromLineOverride=.*/FromLineOverride=$FromOverride/" /etc/ssmtp/ssmtp.conf > /etc/ssmtp/ssmtp.conf.tmp
@@ -61,6 +62,7 @@
 	touch /etc/ssmtp/ssmtp.conf
 	chmod 640 /etc/ssmtp/ssmtp.conf
 	chown root:mail /etc/ssmtp/ssmtp.conf
+	dpkg-statoverride --list /usr/sbin/ssmtp >/dev/null || \
 	dpkg-statoverride --update --add root mail 2755 /usr/sbin/ssmtp
 
 	exec 1>/etc/ssmtp/ssmtp.conf
diff -Nru ssmtp-2.64/debian/postrm ssmtp-2.64/debian/postrm
--- ssmtp-2.64/debian/postrm	2009-07-07 09:30:45.0 +0700
+++ ssmtp-2.64/debian/postrm	2010-03-14 16:08:03.0 +0700
@@ -2,6 +2,7 @@
 
 set -e
 
+
 if test "$1" = "purge"
 then
 	if test -e /usr/share/debconf/confmodule
@@ -20,6 +21,9 @@
 	then
 		rm -f /usr/doc/ssmtp 2>/dev/null || true
 	fi
+	dpkg-statoverride --list /usr/sbin/ssmtp >/dev/null && \
+	dpkg-statoverride --remove /usr/sbin/ssmtp
+
 fi
 
 # Program End


Bug#572154: ssmtp: fails to reinstall

2010-03-01 Thread Sune Vuorela
Package: ssmtp
Version: 2.64-3
Severity: serious
Justification: .


Hi

I did apt-get --reinstall install ssmtp and it failed as follows:

0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 11 not upgraded.
Need to get 0B/53.9kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
(Reading database ... 69662 files and directories currently installed.)
Preparing to replace ssmtp 2.64-3 (using .../ssmtp_2.64-3_amd64.deb) ...
Unpacking replacement ssmtp ...
Processing triggers for man-db ...
Setting up ssmtp (2.64-3) ...
dpkg-statoverrides: An override for '/usr/sbin/ssmtp' already exists, aborting.
dpkg: error processing ssmtp (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 ssmtp
E: Sub-process /usr/bin/dpkg returned an error code (1)

Same issues happens with apt-get install ssmtp ; apt-get remove ssmtp ; apt-get 
install ssmtp

/Sune


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-2-686 (SMP w/1 CPU core)
Locale: LANG=en_DK.ISO-8859-15, LC_CTYPE=en_DK.ISO-8859-15 (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/dash



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org