[Pkg-mailman-hackers] Pkg-mailman commit - rev 375 -
branches/2.1.8/debian
Hector Garcia
hector at costa.debian.org
Tue Sep 19 18:59:58 UTC 2006
Author: hector
Date: 2006-09-19 18:59:57 +0000 (Tue, 19 Sep 2006)
New Revision: 375
Modified:
branches/2.1.8/debian/changelog
branches/2.1.8/debian/config
branches/2.1.8/debian/postinst
branches/2.1.8/debian/postrm
branches/2.1.8/debian/prerm
Log:
Merging revisions 337 to 338 from trunk
Modified: branches/2.1.8/debian/changelog
===================================================================
--- branches/2.1.8/debian/changelog 2006-09-19 18:54:50 UTC (rev 374)
+++ branches/2.1.8/debian/changelog 2006-09-19 18:59:57 UTC (rev 375)
@@ -6,8 +6,11 @@
[ Thijs Kinkhorst ]
* Use LSB output functions in init script.
* Use chown root:list instead of deprecated root.list.
+ * Remove pre-sarge upgrading code; this eliminates a lot of cruft,
+ non-debconf prompting and two debconf templates.
+ * Only use ucf on purge when it's available.
- -- Thijs Kinkhorst <thijs at debian.org> Wed, 16 Aug 2006 15:12:04 +0200
+ -- Thijs Kinkhorst <thijs at debian.org> Tue, 22 Aug 2006 02:09:00 +0200
mailman (1:2.1.8-2) unstable; urgency=low
Modified: branches/2.1.8/debian/config
===================================================================
--- branches/2.1.8/debian/config 2006-09-19 18:54:50 UTC (rev 374)
+++ branches/2.1.8/debian/config 2006-09-19 18:59:57 UTC (rev 375)
@@ -44,13 +44,7 @@
db_fget mailman/used_languages scanned || true
scanned="${RET}"
-if [ ! -z "$2" ] && dpkg --compare-versions $2 lt 2.1 ; then
- # list_lists will fail when upgrading from pre 2.1; but with those
- # versions not supporting i18n, english was the only used language.
- db_set mailman/site_languages "en"
- db_set mailman/used_languages "en"
- db_fset mailman/used_languages scanned false
-elif [ ! -x "/usr/sbin/list_lists" ] ; then
+if [ ! -x "/usr/sbin/list_lists" ] ; then
# For 1st time installers there is no used language.
db_set mailman/site_languages "en"
db_set mailman/used_languages ""
Modified: branches/2.1.8/debian/postinst
===================================================================
--- branches/2.1.8/debian/postinst 2006-09-19 18:54:50 UTC (rev 374)
+++ branches/2.1.8/debian/postinst 2006-09-19 18:59:57 UTC (rev 375)
@@ -27,24 +27,6 @@
mm_etc=/etc/mailman
mm_dist=/usr/share/mailman
- if [ "$2" != "" ] && dpkg --compare-versions "$2" lt "2.1"; then
- # We need to update the aliases
- mm_MTA=`grep ^MTA "/etc/mailman/mm_cfg.py" | sed "s/^MTA[[:space:]]*=[[:space:]]*'\\?\\(None\|Manual\|Postfix\\).*/\1/"`
- case $mm_MTA in
- Postfix)
- /var/lib/mailman/genaliases
- ;;
- None)
- # nothing to do
- ;;
- Manual)
- db_input critical mailman/update_aliases || true
- ;;
- esac
- db_input critical mailman/update_passwords || true
- db_go
- fi
-
# Install only languages selected by the administrator
# forcing used languages to be always available.
db_get mailman/site_languages
@@ -81,7 +63,6 @@
# we access its hashfile directly
md5sums=$(tempfile --prefix=mm_${lang})
grep "^[[:xdigit:]]{32}[[:space:]]\+${mm_etc}/$lang/" /var/lib/ucf/hashfile >${md5sums} || true
- if [ -s ${md5sums} ]; then
# Language files are under ucf control, check md5sums
# LEM: The ":\?" is there to accomodate both md5sum from dpkg (in sarge)
# and md5sum from coreutils (in etch and onwards).
@@ -97,20 +78,6 @@
rm -f ${file}.dpkg-dist
echo -n . >&2
done
- else
- # We are upgrading from a version that didn't use ucf for this
- # language, remove files that are unchanged in the NEW version.
- # At this point there is no way to differentiate between
- # 'changed by admin' and 'changed in package'.
- for file in $(cd /etc && find mailman/${lang} -type f -a ! -name \*.dpkg-\* ); do
- if cmp -s /etc/${file} /usr/share/${file}; then
- rm -f /etc/${file} /etc/${file}.dpkg-dist
- else
- echo /etc/${file} >>${leftover}
- fi
- echo -n . >&2
- done
- fi
echo " done." >&2
rmdir ${mm_etc}/${lang} 2>/dev/null \
|| echo "Directory ${mm_etc}/${lang} not empty, not removed." >&2
@@ -118,25 +85,6 @@
fi
done
- if [ -s ${leftover} ]; then
- cat >&2 <<EOF
-
-----------------------------------------------------------------------
-Some templates from unused langugages could not be automatically
-removed since there was no way to find out if they were modified by
-you or the prototype in the package differs from the previous release.
-${leftover} lists these files; please move them out of the way
-at your discretion if you don't want to see this message again.
-----------------------------------------------------------------------
-
-EOF
- echo -n "Hit return to continue." >&2
- read junk </dev/tty
- echo >&2
- else
- rm ${leftover}
- fi
-
for lang in ${site_languages}; do
echo -n "Installing site language ${lang} " >&2
mkdir -p ${mm_etc}/${lang}
@@ -192,67 +140,8 @@
# GZIP_ARCHIVE_TXT_FILES is false in mm_cfg.py
27 3 * * * list [ -x /usr/lib/mailman/cron/nightly_gzip ] && /usr/lib/mailman/cron/nightly_gzip
EOF
- elif dpkg --compare-versions "$2" lt 2.1; then
- # In versions before 2.1, /etc/cron.{daily,monthly}/mailman did
- # some stuff which is now moved into /etc/cron.d/mailman.
- # Those files are just removed, since they now serve no useful
- # purpose.
- rm -f /etc/cron.daily/mailman /etc/cron.monthly/mailman
-
- # Comment out any lines containing qrunner, since it is no longer
- # used.
- awk '/^[^#]*qrunner/ { print "# " $LINE;next }; //' < /etc/cron.d/mailman > /etc/cron.d/mailman.$$
- mv -f /etc/cron.d/mailman.$$ /etc/cron.d/mailman
-
- # Add those lines which were removed from cron.{daily,monthly}
- grep -q '/usr/lib/mailman/cron/checkdbs' /etc/cron.d/mailman || cat >> /etc/cron.d/mailman <<EOF
-# At 8AM every day, mail reminders to admins as to pending requests.
-# They are less likely to ignore these reminders if they're mailed
-# early in the morning, but of course, this is local time... ;)
-0 8 * * * list [ -x /usr/lib/mailman/cron/checkdbs ] && /usr/lib/mailman/cron/checkdbs
-EOF
-
- grep -q '/usr/lib/mailman/cron/disabled' /etc/cron.d/mailman || cat >> /etc/cron.d/mailman <<EOF
-#
-# At 9AM, send notifications to disabled members that are due to be
-# reminded to re-enable their accounts.
-0 9 * * * list [ -x /usr/lib/mailman/cron/disabled ] && /usr/lib/mailman/cron/disabled
-EOF
-
- grep -q '/usr/lib/mailman/cron/senddigests' /etc/cron.d/mailman || cat >> /etc/cron.d/mailman <<EOF
-#
-# Noon, mail digests for lists that do periodic as well as threshhold delivery.
-0 12 * * * list [ -x /usr/lib/mailman/cron/senddigests ] && /usr/lib/mailman/cron/senddigests
-EOF
-
- grep -q '/usr/lib/mailman/cron/mailpasswds' /etc/cron.d/mailman || cat >> /etc/cron.d/mailman <<EOF
-#
-# 5 AM on the first of each month, mail out password reminders.
-0 5 1 * * list [ -x /usr/lib/mailman/cron/mailpasswds ] && /usr/lib/mailman/cron/mailpasswds
-EOF
- grep -q '/usr/lib/mailman/cron/nightly_gzip' /etc/cron.d/mailman || cat >> /etc/cron.d/mailman <<EOF
-#
-# At 3:27am every night, regenerate the gzip'd archive file. Only
-# turn this on if the internal archiver is used and
-# GZIP_ARCHIVE_TXT_FILES is false in mm_cfg.py
-27 3 * * * list [ -x /usr/lib/mailman/cron/nightly_gzip ] && /usr/lib/mailman/cron/nightly_gzip
-EOF
fi
- # This fuckup got in 2.1-4, it should be removed at sarge + 1
- for pattern in '0 8 \* \* \* /usr/lib/mailman/cron/checkdbs'\
- '0 9 \* \* \* /usr/lib/mailman/cron/disabled' \
- '0 12 \* \* \* /usr/lib/mailman/cron/senddigests' \
- '0 5 1 \* \* /usr/lib/mailman/cron/mailpasswds' \
- '27 3 \* \* \* /usr/lib/mailman/cron/nightly_gzip' \
- '0,5,10,15,20,25,30,35,40,45,50,55 \* \* \* \* /usr/lib/mailman/cron/gate_news'; do
- if grep -q "$pattern" /etc/cron.d/mailman; then
- replacement=$(echo "$pattern" | sed -e 's,/usr/lib,list /usr/lib,')
- sed -e "s|$pattern|$replacement|" < /etc/cron.d/mailman > /etc/cron.d/mailman.$$
- mv -f /etc/cron.d/mailman.$$ /etc/cron.d/mailman
- fi
- done
-
# This should be removed after etch is released, it crept in in 2.1.5-1
if grep -q "gate_news]" /etc/cron.d/mailman; then
sed -e 's/gate_news]/gate_news ]/' < /etc/cron.d/mailman > /etc/cron.d/mailman.$$
@@ -270,28 +159,6 @@
mv -f /etc/cron.d/mailman.$$ /etc/cron.d/mailman
if [ -e /etc/mailman/mm_cfg.py ]; then
- if grep -q "^PUBLIC_ARCHIVE_URL *= *'/pipermail'" /etc/mailman/mm_cfg.py; then
- # Upgrading from 2.0 changed the semantics of PUBLIC_ARCHIVE_URL.
- # Remove post sarge+1
- awk '/^PUBLIC_ARCHIVE_URL/ { print "# " $LINE;next }; //' < /etc/mailman/mm_cfg.py > /etc/mailman/mm_cfg.py.$$
- mv -f /etc/mailman/mm_cfg.py.$$ /etc/mailman/mm_cfg.py
- fi
- if ! grep -q DEFAULT_EMAIL_HOST /etc/mailman/mm_cfg.py; then
- # upgrading from 2.0, add DEFAULT_EMAIL_HOST, remove post-sarge+1
- printf "\nDEFAULT_EMAIL_HOST = DEFAULT_HOST_NAME" >> /etc/mailman/mm_cfg.py
- fi
-
- if ! grep -q DEFAULT_URL_HOST /etc/mailman/mm_cfg.py; then
- # upgrading from 2.0, add DEFAULT_URL_HOST, remove post-sarge+1
- printf "\nDEFAULT_URL_HOST = DEFAULT_HOST_NAME" >> /etc/mailman/mm_cfg.py
- fi
-
- # Uncruftify. I was on something bad.
- rm -f /etc/cron.d/mm_cfg.py
-
- if ! grep -q DEFAULT_SERVER_LANGUAGE /etc/mailman/mm_cfg.py; then
- printf "\nDEFAULT_SERVER_LANGUAGE = 'en'" >> /etc/mailman/mm_cfg.py
- fi
db_get mailman/default_server_language || true
if [ ${RET} ]; then
default_server_language=${RET}
Modified: branches/2.1.8/debian/postrm
===================================================================
--- branches/2.1.8/debian/postrm 2006-09-19 18:54:50 UTC (rev 374)
+++ branches/2.1.8/debian/postrm 2006-09-19 18:59:57 UTC (rev 375)
@@ -7,13 +7,15 @@
if [ "$1" = purge ]; then
# HACK: At present there is no way to ask ucf for registered files
# except for directly querying its database.
- echo -n "Purging files from ucf database " >&2
- for file in $(sed -e '\|^[0-9a-fA-F]\+[[:space:]]\+/etc/mailman/|!d' -e 's|^[0-9a-fA-F]\+[[:space:]]\+||' /var/lib/ucf/hashfile); do
- ucf --purge ${file} 2>/dev/null
- echo -n . >&2
- done
- ucf --purge /etc/cron.d/mailman 2>/dev/null
- echo ". done." >&2
+ if which ucf >/dev/null; then
+ echo -n "Purging files from ucf database " >&2
+ for file in $(sed -e '\|^[0-9a-fA-F]\+[[:space:]]\+/etc/mailman/|!d' -e 's|^[0-9a-fA-F]\+[[:space:]]\+||' /var/lib/ucf/hashfile); do
+ ucf --purge ${file} 2>/dev/null
+ echo -n . >&2
+ done
+ ucf --purge /etc/cron.d/mailman 2>/dev/null
+ echo ". done." >&2
+ fi
fi
if [ "$1" = purge ]; then
Modified: branches/2.1.8/debian/prerm
===================================================================
--- branches/2.1.8/debian/prerm 2006-09-19 18:54:50 UTC (rev 374)
+++ branches/2.1.8/debian/prerm 2006-09-19 18:59:57 UTC (rev 375)
@@ -6,24 +6,9 @@
# $URL$
# $Id$
-# Hack to allow upgrade from broken 2.1.1 installs where stopping
-# mailman will fail. This hack can be removed after sarge+1 is released.
-
-if [ "$1" = "failed-upgrade" -a \( "$2" = "2.1.1-1" -o \
- "$2" = "2.1.1-2" -o "$2" = "2.1.1-3" \) ]; then
+if [ "$1" = "failed-upgrade" ] ; then
if [ -x "/etc/init.d/mailman" ]; then
if [ -x /usr/sbin/invoke-rc.d ] ; then
- invoke-rc.d mailman stop || true
- else
- /etc/init.d/mailman stop || true
- fi
- fi
- chmod -x /usr/lib/mailman/bin/mailmanctl
-fi
-
-if [ "$1" = "failed-upgrade" ] && dpkg --compare-versions "$2" gt "2.1.4-2" ; then
- if [ -x "/etc/init.d/mailman" ]; then
- if [ -x /usr/sbin/invoke-rc.d ] ; then
invoke-rc.d mailman stop || true
else
/etc/init.d/mailman stop || true
More information about the Pkg-mailman-hackers
mailing list