diff options
author | mandree <mandree@FreeBSD.org> | 2014-05-16 23:56:24 +0800 |
---|---|---|
committer | mandree <mandree@FreeBSD.org> | 2014-05-16 23:56:24 +0800 |
commit | 1fb7efdfdbe3478c49945a34bb7c71d3a6f18a02 (patch) | |
tree | 24027d3dc9e4dd63a2897b5325c47e35c869ed98 /mail | |
parent | b1e7c0a21a5a84a84d673d0c4c0ef7de29722b55 (diff) | |
download | freebsd-ports-graphics-1fb7efdfdbe3478c49945a34bb7c71d3a6f18a02.tar.gz freebsd-ports-graphics-1fb7efdfdbe3478c49945a34bb7c71d3a6f18a02.tar.zst freebsd-ports-graphics-1fb7efdfdbe3478c49945a34bb7c71d3a6f18a02.zip |
Avoid leftovers on pkg_add-based systems by running a
depth-first remove of empty directories under the Mailman directory.
Submitted by: jenkins/swills@
Diffstat (limited to 'mail')
-rw-r--r-- | mail/mailman/Makefile | 1 | ||||
-rw-r--r-- | mail/mailman/files/pkg-deinstall.in | 13 | ||||
-rw-r--r-- | mail/mailman/files/pkg-install.in | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/mail/mailman/Makefile b/mail/mailman/Makefile index 59d4830a531..bd58ae6d28c 100644 --- a/mail/mailman/Makefile +++ b/mail/mailman/Makefile @@ -3,6 +3,7 @@ PORTNAME= mailman DISTVERSION= 2.1.18-1 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_GNU} \ SF/${PORTNAME}/Mailman%202.1%20%28stable%29/${PORTVERSION} \ diff --git a/mail/mailman/files/pkg-deinstall.in b/mail/mailman/files/pkg-deinstall.in index 8cdfcab343c..f8a389e8d54 100644 --- a/mail/mailman/files/pkg-deinstall.in +++ b/mail/mailman/files/pkg-deinstall.in @@ -5,14 +5,13 @@ PATH=/bin:/usr/bin:/usr/sbin case $2 in - DEINSTALL) - echo "---> Starting deinstall script:" + echo "---> Starting deinstall script" if /usr/bin/crontab -u "%%USER%%" -l | \ - /usr/bin/diff - "%%MAILMANDIR%%/cron/crontab.in" >/dev/null 2>&1 ; then + /usr/bin/diff -B -b - "%%MAILMANDIR%%/cron/crontab.in" >/dev/null 2>&1 ; then echo "---> Zeroing crontab for \"%%USER%%\"" - /usr/bin/crontab -u "%%USER%%" /dev/null + /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 @@ -38,11 +37,13 @@ DEINSTALL) ;; POST-DEINSTALL) - echo "---> Starting post-deinstall script:" + echo "---> Starting post-deinstall script" - rmdir "%%MAILMANDIR%%" >/dev/null 2>&1 + # try to kill all empty directories - necessary on pkg_add-based systems + find "%%MAILMANDIR%%" -depth -type d -exec rmdir '{}' + >/dev/null 2>&1 || : if [ -d "%%MAILMANDIR%%" ]; then echo '---> %%MAILMANDIR%% is not empty - this installation may have active lists!' + ls -lRB "%%MAILMANDIR%%" | head -n200 || : echo "---> Restoring \"last_mailman_version\" file" /bin/mkdir -p "%%MAILMANDIR%%/data" /bin/mv -f /var/tmp/last_mailman_version "%%MAILMANDIR%%/data/" diff --git a/mail/mailman/files/pkg-install.in b/mail/mailman/files/pkg-install.in index 139787b9df3..53564cac299 100644 --- a/mail/mailman/files/pkg-install.in +++ b/mail/mailman/files/pkg-install.in @@ -7,14 +7,14 @@ PATH=/bin:/usr/bin:/usr/sbin case $2 in POST-INSTALL) - echo "---> Starting post-install script:" + echo "---> Starting post-install script" MYTMP="$(mktemp -d "${TMPDIR-/tmp}/mminstall.XXXXXXXXXX")" || exit 1 trap "rm -rf \"$MYTMP\"" EXIT /bin/chmod g+s "%%MAILMANDIR%%" || exit 1 - echo "---> Running update:" + echo "---> Running update" LC_ALL=C "%%MAILMANDIR%%/bin/update" || exit 1 |