AlkantarClanX12
| Current Path : /var/lib/dpkg/info/ |
| Current File : /var/lib/dpkg/info/mailman.preinst |
#!/bin/sh -e
# $URL: svn+ssh://svn.debian.org/svn/pkg-mailman/trunk/debian/preinst.in $
# $Id: preinst.in 704 2012-03-18 13:14:40Z thijs $
. /usr/share/debconf/confmodule
# If we encounter a cron.d file that was originally installed by this package,
# we remove it here so it will be replaced by a properly managed one after
# the package upgrade.
# This can be removed after wheezy's release.
if [ -e /etc/cron.d/mailman ] && dpkg --compare-versions "$2" le "1:2.1.14-3"; then
md5sum="$(md5sum /etc/cron.d/mailman | sed -e 's/ .*//')"
if [ "$md5sum" = "06648bbab6cf2c5c1f542b31a51d8338" ]; then
rm /etc/cron.d/mailman
fi
fi
abort_install()
{
db_fset mailman/queue_files_present seen false || true
db_input critical mailman/queue_files_present || true
db_go
db_get mailman/queue_files_present
if [ "$RET" = "abort installation" ]; then
exit 1
fi
}
# make sure the qfiles directory is empty.
if [ -d /var/lib/mailman/qfiles ] && \
[ "$(find /var/lib/mailman/qfiles -type f | wc -l)" -ne 0 ]; then
# Check if the queue files were created by the same version as the one we're about to install
if [ -r /var/lib/mailman/.version ]; then
# First check the stamp file.
# It is more general because it will show the previous version in the
# case that /var/lib/mailman is on permanent storage (e.g. a SAN) and
# we are being installed for the first time.
previous_version=$(cat /var/lib/mailman/.version)
else
# Fall back to reading dpkg-provided argument (in case previous version did not leave the stamp file)
previous_version="$2"
fi
if [ "1:2.1.23-1+deb9u8" != "${previous_version}" ]; then
# we don't know which version the files are from
abort_install
fi
fi
exit 0