[Pkg-sympa-commits] [sympa] 16/28: Some improvements in sympa aliases file management from post{rm, inst}
Emmanuel Bouthenot
kolter at moszumanska.debian.org
Wed Jun 11 21:53:03 UTC 2014
This is an automated email from the git hooks/post-receive script.
kolter pushed a commit to branch master
in repository sympa.
commit 03ac22e6256d3ba40be3df3577ca5b2af34372fe
Author: Emmanuel Bouthenot <kolter at openics.org>
Date: Tue May 20 07:40:49 2014 +0200
Some improvements in sympa aliases file management from post{rm,inst}
---
debian/sympa.postinst | 18 +++++++++---------
debian/sympa.postrm | 3 +++
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/debian/sympa.postinst b/debian/sympa.postinst
index fc6971c..69731bf 100644
--- a/debian/sympa.postinst
+++ b/debian/sympa.postinst
@@ -153,10 +153,9 @@ if [ -d /etc/sympa/config ]; then
rmdir /etc/sympa/config || true
fi
-# Remove old sympa aliases
-if [ -f /etc/aliases ]; then
- sed -i -e '/#-- SYMPA begin/,/#-- SYMPA end/d' /etc/aliases
- newaliases || true
+# Create file for mailing list aliases
+if [ ! -f /etc/mail/sympa/aliases ]; then
+ echo "## List aliases used for the sympa mailing-list manager" > /etc/mail/sympa/aliases
fi
# Moving alias files to a destination where SYMPA can write
@@ -176,11 +175,6 @@ if [ -d /etc/mail/sympa ]; then
done
fi
-# Create file for mailing list aliases
-if [ ! -f /etc/mail/sympa/aliases ]; then
- echo "## List aliases used for the sympa mailing-list manager" > /etc/mail/sympa/aliases
-fi
-
# Ensure permissions are correct
for ext in '' '.db' ; do
if [ -f /etc/mail/sympa/aliases${ext} ]; then
@@ -188,6 +182,12 @@ for ext in '' '.db' ; do
fi
done
+# Remove old sympa aliases
+if [ -f /etc/aliases ]; then
+ sed -i -e '/#-- SYMPA begin/,/#-- SYMPA end/d' /etc/aliases
+ newaliases || true
+fi
+
## Create a unique cookie for this host
if [ ! -e /etc/sympa/cookie ]; then
touch /etc/sympa/cookie
diff --git a/debian/sympa.postrm b/debian/sympa.postrm
index 23605dd..d3b114a 100644
--- a/debian/sympa.postrm
+++ b/debian/sympa.postrm
@@ -57,6 +57,9 @@ if [ "$1" = "purge" ]; then
rm -f /etc/sympa/sympa.conf
rm -f /etc/sympa/wwsympa.conf
+ # Remove sympa aliases
+ rm -f /etc/sympa/aliases /etc/sympa/aliases.db
+
# Try to remove if empty
rmdir /etc/sympa 2>/dev/null || true
--
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