[Pkg-sympa-commits] [SCM] sympa Debian packaging branch, master, updated. debian/6.1.7_dfsg-2-31-g348d434

Emmanuel Bouthenot kolter at openics.org
Sat May 19 14:51:42 UTC 2012


The following commit has been merged in the master branch:
commit 6bc5bf8b7fe927128510883ce9a3ee8fd3355153
Author: Emmanuel Bouthenot <kolter at openics.org>
Date:   Sat May 19 12:37:21 2012 +0000

    Do not handle /etc/sympa/data_structure.version as a conffile as it breaks sympa internals upgrade (#655967)

diff --git a/debian/control b/debian/control
index bf14d9d..2e748cc 100644
--- a/debian/control
+++ b/debian/control
@@ -36,6 +36,7 @@ Homepage: http://www.sympa.org/
 
 Package: sympa
 Architecture: any
+Pre-Depends: dpkg (>= 1.15.7.2~)
 Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}, ${cdbs:Depends}
 Replaces: wwsympa
 Provides: wwsympa
diff --git a/debian/rules b/debian/rules
index 872f149..b4a58da 100755
--- a/debian/rules
+++ b/debian/rules
@@ -161,6 +161,9 @@ binary-post-install/sympa::
 	mv "$(DEB_DESTDIR)"/usr/share/doc/$(cdbs_curpkg)/examples/config/topics.conf \
 		"$(DEB_DESTDIR)"/usr/share/doc/$(cdbs_curpkg)/examples/config/topics.us.conf
 
+# We cannot handle /etc/sympa/data_structure.version as a conffile
+	rm -f "$(DEB_DESTDIR)"/etc/sympa/data_structure.version
+
 # Fix permissions on SQL schemas
 	chmod -x "$(DEB_DESTDIR)"/usr/share/$(cdbs_curpkg)/bin/create_db.*
 
diff --git a/debian/sympa.lintian-overrides b/debian/sympa.lintian-overrides
index 752f344..ddc71ce 100644
--- a/debian/sympa.lintian-overrides
+++ b/debian/sympa.lintian-overrides
@@ -1,2 +1,2 @@
-sympa: possible-bashism-in-maintainer-script postinst:247 '(type '
+sympa: possible-bashism-in-maintainer-script postinst:266 '(type '
 sympa: package-contains-broken-symlink usr/share/sympa/default/ca-bundle.crt etc/ssl/certs/ca-certificates.crt
diff --git a/debian/sympa.postinst b/debian/sympa.postinst
index 424c621..7d82f84 100644
--- a/debian/sympa.postinst
+++ b/debian/sympa.postinst
@@ -1,5 +1,9 @@
 #!/bin/sh
 
+#
+# postinst script for sympa
+#
+
 set -e
 
 # Source debconf library
@@ -9,6 +13,31 @@ set -e
 conf=/etc/sympa/sympa.conf
 wwconf=/etc/sympa/wwsympa.conf
 
+sympa_version() {
+	perl -e "use lib '/usr/share/sympa/lib'; use Sympa::Constants; print Sympa::Constants::VERSION;"
+}
+
+# /etc/sympa/data_structure.version should not be handled as a conffile as it
+# is modified by sympa upgrade tool and it breaks the sympa upgrade process
+# itsself (#655967)
+if [ -f /etc/sympa/data_structure.version ] && [ ! -f /etc/sympa/data_structure.version.debian-old ]; then
+	cp /etc/sympa/data_structure.version /etc/sympa/data_structure.version.debian-old
+fi
+if which dpkg-maintscript-helper >/dev/null && dpkg-maintscript-helper supports rm_conffile ; then
+	dpkg-maintscript-helper rm_conffile /etc/sympa/data_structure.version \
+		"6.1.11~dfsg-1~" -- "$@"
+fi
+
+# Ensure that data structure version file exists and is writable for Sympa
+if [ -f /etc/sympa/data_structure.version.debian-old ]; then
+	cp /etc/sympa/data_structure.version.debian-old /etc/sympa/data_structure.version
+	rm -f /etc/sympa/data_structure.version.debian-old
+fi
+if [ ! -f /etc/sympa/data_structure.version ]; then
+	sympa_version > /etc/sympa/data_structure.version
+fi
+chown sympa:sympa /etc/sympa/data_structure.version
+
 # creating sympa user if he isn't already there
 if ! getent passwd sympa >/dev/null ; then
 	echo "Adding system user: sympa."
@@ -27,16 +56,6 @@ if [ "$1" = "configure" ]; then
 	fi
 fi
 
-# Ensure that data structure version file exists and is writable for Sympa
-if [ ! -f /etc/sympa/data_structure.version ] && [ "$1" = "configure" ]; then
-	if [ -n "$2" ] && dpkg --compare-versions "$2" lt "5.2.3"; then
-		echo "$2" > /etc/sympa/data_structure.version
-	else
-		touch /etc/sympa/data_structure.version
-	fi
-fi
-chown sympa:sympa /etc/sympa/data_structure.version
-
 # Install sympa.conf
 if [ -f "$conf" ]; then
 	# Replace/disable obsolete settings in configuration file
diff --git a/debian/sympa.postrm b/debian/sympa.postrm
index ce79065..785d9b7 100644
--- a/debian/sympa.postrm
+++ b/debian/sympa.postrm
@@ -101,6 +101,7 @@ case "$1" in
 
 		# Remove configuration files
 		rm -f /etc/sympa/data_structure.version
+		rm -f /etc/sympa/data_structure.version.debian-old
 		rm -f /etc/sympa/sympa.conf
 		rm -f /etc/sympa/wwsympa.conf
 
diff --git a/debian/sympa.preinst b/debian/sympa.preinst
new file mode 100644
index 0000000..f643c6b
--- /dev/null
+++ b/debian/sympa.preinst
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+#
+# preinst script for sympa
+#
+
+set -e
+
+# /etc/sympa/data_structure.version should not be handled as a conffile as it
+# is modified by sympa upgrade tool and it breaks the sympa upgrade process
+# itsself (#655967)
+# In order do manage configuration where /etc/sympa/data_structure.version was
+# a conffile, we create a backup with the current version in
+# /etc/sympa/data_structure.version.debian-old so that it will be possible to
+# run sympa upgrade tool in postinst script with the right version
+if [ -f /etc/sympa/data_structure.version ] && [ ! -f /etc/sympa/data_structure.version.debian-old ]; then
+	cp /etc/sympa/data_structure.version /etc/sympa/data_structure.version.debian-old
+fi
+if which dpkg-maintscript-helper >/dev/null && dpkg-maintscript-helper supports rm_conffile ; then
+	dpkg-maintscript-helper rm_conffile /etc/sympa/data_structure.version \
+		"6.1.11~dfsg-1~" -- "$@"
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/sympa.prerm b/debian/sympa.prerm
index a73093d..910523e 100644
--- a/debian/sympa.prerm
+++ b/debian/sympa.prerm
@@ -1,13 +1,24 @@
 #!/bin/sh
 
+#
+# prerm script for sympa
+#
+
 set -e
 
 . /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/prerm 
+. /usr/share/dbconfig-common/dpkg/prerm
 dbc_go sympa $@
 
 if [ "$1" = "remove" ]; then
 	rm -f /etc/mail/smrsh/bouncequeue /etc/mail/smrsh/queue
 fi
 
+if which dpkg-maintscript-helper >/dev/null && dpkg-maintscript-helper supports rm_conffile ; then
+	dpkg-maintscript-helper rm_conffile /etc/sympa/data_structure.version \
+		"6.1.11~dfsg-1~" -- "$@"
+fi
+
 #DEBHELPER#
+
+exit 0

-- 
sympa Debian packaging



More information about the Pkg-sympa-commits mailing list