mirror of
https://git.freebsd.org/ports.git
synced 2025-06-21 20:50:31 -04:00
- Move directory permission handling into pkg-install, to work around pkg/libarchive issues on 9.3. - Handle some crucial directory permissions directly in pkg-install, so that running check_perms becomes optional. - Try a bit harder to preserve permissions on the archives/private dir. - The rcfile now fixes directory permissions by default on start. - You can now set mailman_fix_perms="NO" in the /etc/rc.conf* files, to avoid running check_perms -f on start, or from pkg-install. - Clean up pkg-plist. - Bump PORTREVISION to 6. Suggested by: bapt@, peter@
59 lines
2.1 KiB
Bash
59 lines
2.1 KiB
Bash
#! /bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
|
|
PATH=/bin:/usr/bin:/usr/sbin
|
|
|
|
case "$2" in
|
|
DEINSTALL)
|
|
echo "---> Starting deinstall script"
|
|
|
|
if /usr/bin/crontab -u "%%USER%%" -l | \
|
|
/usr/bin/diff -B -b - "%%MAILMANDIR%%/cron/crontab.in" >/dev/null 2>&1 ; then
|
|
echo "---> Zeroing crontab for \"%%USER%%\""
|
|
/usr/bin/crontab -u "%%USER%%" -r </dev/null
|
|
if [ -e /var/cron/allow ]; then
|
|
grep -v "^%%USER%%$" /var/cron/allow > /var/cron/allow.new$$
|
|
mv /var/cron/allow.new$$ /var/cron/allow
|
|
fi
|
|
else
|
|
echo "---> Crontab for \"%%USER%%\" modified, not removed: please deinstall"
|
|
echo "---> it manually if you no longer wish to use Mailman. E.g.:"
|
|
echo "---> /usr/bin/crontab -u \"%%USER%%\" -r"
|
|
fi
|
|
|
|
echo "---> Preserving the \"last_mailman_version\" file"
|
|
/bin/mv -f "%%MAILMANDIR%%/data/last_mailman_version" /var/tmp/ || :
|
|
|
|
# If the errorlog is the only existing logfile, delete it. (If Mailman's
|
|
# qrunner had not been running, then the process of trying to stop the
|
|
# qrunner (above) will cause the errorlog to be written to. Hence, even if
|
|
# the Mailman port/package is installed and immediately deinstalled, the
|
|
# errorlog will exist.)
|
|
if [ "`echo %%MAILMANDIR%%/logs/*`" = "%%MAILMANDIR%%/logs/error" ]; then
|
|
echo "---> Deleting errorlog (It is the only existing logfile.)"
|
|
/bin/rm -f "%%MAILMANDIR%%/logs/error"
|
|
fi
|
|
|
|
# attempt removal, but do not care if it is not empty
|
|
/bin/rmdir "%%MAILMANDIR%%/archives/private/" 2>/dev/null || :
|
|
;;
|
|
|
|
POST-DEINSTALL)
|
|
echo "---> Starting post-deinstall script"
|
|
|
|
set -- "%%MAILMANDIR%%/lists"/*
|
|
if [ $# -gt 1 ] || [ "x$1" != "x%%MAILMANDIR%%/lists/*" ] ; then
|
|
echo '---> %%MAILMANDIR%%/lists is not empty - this installation may have active lists! Listing max. 10:'
|
|
find "%%MAILMANDIR%%/lists" -mindepth 1 -maxdepth 1 | head -n 10 || :
|
|
echo "---> Restoring \"last_mailman_version\" file"
|
|
if test -d "%%MAILMANDIR%%" ; then
|
|
/bin/mkdir -p "%%MAILMANDIR%%/data" && \
|
|
/bin/mv -f /var/tmp/last_mailman_version "%%MAILMANDIR%%/data/"
|
|
else
|
|
/bin/rm -f /var/tmp/last_mailman_version
|
|
fi
|
|
fi
|
|
|
|
;;
|
|
esac
|