[Pkg-mailman-hackers] Pkg-mailman commit - rev 88 - branches/pkg-split/core/debian
Bernd S. Brentrup
bsb@haydn.debian.org
Sat, 24 Apr 2004 12:01:50 -0600
Author: bsb
Date: 2004-04-24 12:01:41 -0600 (Sat, 24 Apr 2004)
New Revision: 88
Modified:
branches/pkg-split/core/debian/changelog
branches/pkg-split/core/debian/preinst
Log:
preinst: added code to make sure no cruft in
/var/lib/mailman/pythonlib is moved out of the way.
Modified: branches/pkg-split/core/debian/changelog
===================================================================
--- branches/pkg-split/core/debian/changelog 2004-04-24 17:45:21 UTC (rev 87)
+++ branches/pkg-split/core/debian/changelog 2004-04-24 18:01:41 UTC (rev 88)
@@ -6,9 +6,11 @@
closes: #176439, #238377, #233410, #237772).
* Outlining glue packages mailman-spamassassin, mailman-spamprobe,
mailman-savannah and mailman-clamav (bsb, cf debian/TODO).
+ * preinst: Add code making sure /var/lib/mailman/pythonlib doesn't
+ contain cruft from ancient installations (bsb, closes: #242740).
+
+ -- Siggy Brentrup <bsb@debian.org> Sat, 24 Apr 2004 19:59:45 +0200
- -- Siggy Brentrup <bsb@debian.org> Sat, 24 Apr 2004 19:20:28 +0200
-
mailman (2.1.4-4) unstable; urgency=medium
* Urgency medium because RC bugs are fixed.
Modified: branches/pkg-split/core/debian/preinst
===================================================================
--- branches/pkg-split/core/debian/preinst 2004-04-24 17:45:21 UTC (rev 87)
+++ branches/pkg-split/core/debian/preinst 2004-04-24 18:01:41 UTC (rev 88)
@@ -12,17 +12,9 @@
fi
fi
-if [ "$1" = "install" -o "$1" = "upgrade" ]; then
- if [ -d /var/lib/mailman/logs -a ! -L /var/lib/mailman/logs ]; then
- echo "Moving the current logs to /var/lib/mailman/logs.old"
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+ if [ -d /var/lib/mailman/logs ] && [ ! -L /var/lib/mailman/logs ] ; then
echo "New logs will be generated in /var/log/mailman"
- mv /var/lib/mailman/logs /var/lib/mailman/logs.old
- mkdir /var/log/mailman && true
- chown root.list /var/log/mailman
- chmod 2775 /var/log/mailman
- ln -s /var/log/mailman /var/lib/mailman/logs
- echo -n "Press RETURN to continue"
- read foo
fi
fi
@@ -33,9 +25,46 @@
echo "Queue not cleared, please flush mailman queue and retry upgrade"
exit 1
fi
+fi
+pythonlib=/var/lib/mailman/pythonlib
+
+if [ -d ${pythonlib} ] && [ "$(ls -A ${pythonlib})" != "" ] ; then
+ cat <<EOF
+You have a non-empty ${pythonlib}, possibly caused by an incomplete
+removal of an ancient mailman version. In any case it's contents may
+lead to mailman failing in obscure ways.
+
+If you want it to be moved to ${pythonlib}.obsolete.$$ now, answer Y
+to the following question, any other response will abort installation
+and give you the opportunity to examine the situation.
+EOF
+ read -p "Move ${pythonlib} out of the way? [yN] " ans
+ case $ans in
+ y|Y) mv ${pythonlib} ${pythonlib}.obsolete.$$
+ ;;
+ *) exit 1
+ ;;
+ esac
fi
+if [ -L ${pythonlib} ] ; then
+ cat <<EOF
+You have a symbolic link ${pythonlib} pointing to $(readlink ${pythonlib})
+while mailman installs ${pythonlib} as a directory.
+If you want it to be moved to ${pythonlib}.obsolete.$$ now, answer Y
+to the following question, any other response will abort installation
+and give you the opportunity to examine the situation.
+EOF
+ read -p "Move ${pythonlib} out of the way? [yN] " ans
+ case $ans in
+ y|Y) mv ${pythonlib} ${pythonlib}.obsolete.$$
+ ;;
+ *) exit 1
+ ;;
+ esac
+fi
+
#DEBHELPER#
exit 0