summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorjlam <jlam>2004-07-30 23:03:58 +0000
committerjlam <jlam>2004-07-30 23:03:58 +0000
commit2cf2f5f2cc0d8ea56ad1dfe4087d5dae3613725d (patch)
treede3bc37f5a9eaa019796a5fcd178c27013c73d4b /mail
parentb7996a26af8d7e7dfce817175c4d43131abf8fd9 (diff)
downloadpkgsrc-2cf2f5f2cc0d8ea56ad1dfe4087d5dae3613725d.tar.gz
Actually warn about the IMAP directories if they can't be removed.
Removing directories happens at POST-DEINSTALL time, but the imapd.conf file may be removed during the DEINSTALL stop, so we need to add the code to remove the IMAP directories explicitly in the DEINSTALL step, as well.
Diffstat (limited to 'mail')
-rw-r--r--mail/cyrus-imapd22/DEINSTALL35
1 files changed, 27 insertions, 8 deletions
diff --git a/mail/cyrus-imapd22/DEINSTALL b/mail/cyrus-imapd22/DEINSTALL
index 2ad34812c72..26871ca2b64 100644
--- a/mail/cyrus-imapd22/DEINSTALL
+++ b/mail/cyrus-imapd22/DEINSTALL
@@ -1,19 +1,38 @@
-# $NetBSD: DEINSTALL,v 1.2 2004/05/27 04:45:06 jlam Exp $
+# $NetBSD: DEINSTALL,v 1.3 2004/07/30 23:03:58 jlam Exp $
IMAPDCONF=@IMAPDCONF@
case ${STAGE} in
DEINSTALL)
if [ -f ${IMAPDCONF} ]; then
- ${AWK} '/configdirectory:/ { print $2 }; \
- /partition-.*:/ { print $2 }; \
- /sievedir:/ { print $2 }' \
- ${IMAPDCONF} | \
- while read dir; do
- if [ -d "${dir}" ]; then
- ALL_DIRS="${ALL_DIRS} ${dir}"
+ IMAPDIRS=`
+ ${AWK} '/configdirectory:/ { print $2 }; \
+ /partition-.*:/ { print $2 }; \
+ /sievedir:/ { print $2 }' \
+ ${IMAPDCONF} | ${SORT} -ur`
+ _IMAPDIRS=
+ for dir in ${IMAPDIRS}; do
+ ${RMDIR} -p ${dir} 2>/dev/null || ${TRUE}
+ if [ -d ${dir} ]; then
+ _IMAPDIRS="${_IMAPDIRS} ${dir}"
fi
done
+ if [ -n "${_IMAPDIRS}" ]; then
+ ${CAT} << EOF
+===========================================================================
+If you won't be using ${PKGNAME} any longer, you may want to remove
+the following directories:
+
+EOF
+ for dir in ${_IMAPDIRS}; do
+ if [ -d "${dir}" ]; then
+ ${ECHO} " ${dir}"
+ fi
+ done
+ ${CAT} << EOF
+===========================================================================
+EOF
+ fi
fi
;;
esac