[Pkg-sympa-commits] [sympa] 04/06: Properly cleanup backup files created by Sympa during upgrade to 6.2
Emmanuel Bouthenot
kolter at moszumanska.debian.org
Wed Sep 28 21:09:36 UTC 2016
This is an automated email from the git hooks/post-receive script.
kolter pushed a commit to branch master
in repository sympa.
commit 2fe58a8cd7df27d09c8cc3553da748b7c6ca9262
Author: Emmanuel Bouthenot <kolter at openics.org>
Date: Wed Sep 28 23:05:04 2016 +0200
Properly cleanup backup files created by Sympa during upgrade to 6.2
---
debian/sympa.postrm | 121 +++++++++++++++++++++++++++-------------------------
1 file changed, 63 insertions(+), 58 deletions(-)
diff --git a/debian/sympa.postrm b/debian/sympa.postrm
index c41d063..75263f2 100644
--- a/debian/sympa.postrm
+++ b/debian/sympa.postrm
@@ -3,77 +3,82 @@
set -e
if [ -f /usr/share/debconf/confmodule ]; then
- . /usr/share/debconf/confmodule
+ . /usr/share/debconf/confmodule
fi
if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
- . /usr/share/dbconfig-common/dpkg/postrm
- dbc_go sympa $@
+ . /usr/share/dbconfig-common/dpkg/postrm
+ dbc_go sympa $@
fi
# Remove conffiles used by apache2 < 2.4
if which dpkg-maintscript-helper >/dev/null && dpkg-maintscript-helper supports rm_conffile ; then
- for i in apache apache-soap httpd.conf-cgi httpd.conf-fcgi ; do
- dpkg-maintscript-helper rm_conffile "/etc/sympa/${i}" \
- "6.1.17~dfsg-1~" -- "$@"
- done
+ for i in apache apache-soap httpd.conf-cgi httpd.conf-fcgi ; do
+ dpkg-maintscript-helper rm_conffile "/etc/sympa/${i}" \
+ "6.1.17~dfsg-1~" -- "$@"
+ done
fi
if [ "$1" = "remove" ]; then
- if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
- # Apache2 >= 2.4
- . /usr/share/apache2/apache2-maintscript-helper
- apache2_invoke disconf sympa.conf
- apache2_invoke disconf sympa-soap.conf
- fi
+ if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
+ # Apache2 >= 2.4
+ . /usr/share/apache2/apache2-maintscript-helper
+ apache2_invoke disconf sympa.conf
+ apache2_invoke disconf sympa-soap.conf
+ fi
fi
if [ "$1" = "purge" ]; then
- db_input high wwsympa/remove_spool || true
- db_go
- db_get wwsympa/remove_spool
- remove_archives="$RET"
-
- if [ "$remove_archives" = "true" ]; then
- echo "Removing archives and spool subdirectories as requested..."
- rm -rf /var/lib/sympa/wwsarchive 2>/dev/null || true
- rm -rf /var/spool/sympa/wws* 2>/dev/null || true
- fi
-
- # Delete the log files if purging, remove aliases too.
- rm -f /var/log/sympa.log*
-
- # Remove static content directory
- if [ -d /var/lib/sympa/static_content ]; then
- rm -r /var/lib/sympa/static_content
- fi
-
- rm -f /etc/sympa/cookie 2>/dev/null || true
- rm -f /etc/sympa/cookies.history
-
- # 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
-
- # Remove sympa aliases
- rm -f /etc/mail/sympa/aliases /etc/mail/sympa/aliases.db
- newaliases || true
-
- # Try to remove if empty
- rmdir /etc/sympa 2>/dev/null || true
-
- db_input high sympa/remove_spool || true
- db_go
- db_get sympa/remove_spool
- remove_spool="$RET"
-
- if [ "$remove_spool" = "true" ]; then
- echo "Removing lists data and spool directory as requested..."
- rm -rf /var/lib/sympa 2>/dev/null || true
- rm -rf /var/spool/sympa 2>/dev/null || true
- fi
+ db_input high wwsympa/remove_spool || true
+ db_go
+ db_get wwsympa/remove_spool
+ remove_archives="$RET"
+
+ if [ "$remove_archives" = "true" ]; then
+ echo "Removing archives and spool subdirectories as requested..."
+ rm -rf /var/lib/sympa/wwsarchive 2>/dev/null || true
+ rm -rf /var/spool/sympa/wws* 2>/dev/null || true
+ fi
+
+ # Delete the log files if purging, remove aliases too.
+ rm -f /var/log/sympa.log*
+
+ # Remove static content directory
+ if [ -d /var/lib/sympa/static_content ]; then
+ rm -r /var/lib/sympa/static_content
+ fi
+
+ rm -f /etc/sympa/cookie 2>/dev/null || true
+ rm -f /etc/sympa/cookies.history
+
+ # Remove configuration files
+ rm -f /etc/sympa/data_structure.version
+ rm -f /etc/sympa/data_structure.version.debian-old
+ rm -f /etc/sympa/sympa/sympa.conf
+ rm -f /etc/sympa/wwsympa.conf
+ find /etc/sympa -iname '*.conf.bin' -delete
+ # Backup files generated by Sympa while migrating from 6.1 to 6.2
+ find /etc/sympa -regextype egrep -regex \
+ '^.*\.upgrade[0-9]{2}\.\w{3}\.[0-9]{4}-[0-9]{2}\.[0-9]{2}\.[0-9]{2}$' \
+ -delete
+
+ # Remove sympa aliases
+ rm -f /etc/mail/sympa/aliases /etc/mail/sympa/aliases.db
+ newaliases || true
+
+ # Try to remove if empty
+ rmdir /etc/sympa 2>/dev/null || true
+
+ db_input high sympa/remove_spool || true
+ db_go
+ db_get sympa/remove_spool
+ remove_spool="$RET"
+
+ if [ "$remove_spool" = "true" ]; then
+ echo "Removing lists data and spool directory as requested..."
+ rm -rf /var/lib/sympa 2>/dev/null || true
+ rm -rf /var/spool/sympa 2>/dev/null || true
+ fi
fi
#DEBHELPER#
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/sympa.git
More information about the Pkg-sympa-commits
mailing list