summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-07-31 03:28:32 +0000
committerjlam <jlam@pkgsrc.org>2004-07-31 03:28:32 +0000
commit270fefab97c675299331a876af8068d51a04b097 (patch)
treee9c926a4e3ff6844cac991048ed457561b7f6b4c /mail
parent5a34fd5ba01e20632d724c81d362e8324ac36393 (diff)
downloadpkgsrc-270fefab97c675299331a876af8068d51a04b097.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-imapd21/DEINSTALL29
1 files changed, 23 insertions, 6 deletions
diff --git a/mail/cyrus-imapd21/DEINSTALL b/mail/cyrus-imapd21/DEINSTALL
index bbbb355db05..8bddff0e61b 100644
--- a/mail/cyrus-imapd21/DEINSTALL
+++ b/mail/cyrus-imapd21/DEINSTALL
@@ -1,21 +1,38 @@
-# $NetBSD: DEINSTALL,v 1.2 2003/08/30 20:22:56 jlam Exp $
+# $NetBSD: DEINSTALL,v 1.3 2004/07/31 03:28:32 jlam Exp $
IMAPDCONF=@IMAPDCONF@
case ${STAGE} in
DEINSTALL)
if [ -f ${IMAPDCONF} ]; then
- imap_dirs=` \
+ IMAPDIRS=`
${AWK} '/configdirectory:/ { print $2 }; \
/partition-.*:/ { print $2 }; \
/sievedir:/ { print $2 }' \
- ${IMAPDCONF} \
- `
- for dir in ${imap_dirs}; do
+ ${IMAPDCONF} | ${SORT} -ur`
+ _IMAPDIRS=
+ for dir in ${IMAPDIRS}; do
+ ${RMDIR} -p ${dir} 2>/dev/null || ${TRUE}
if [ -d ${dir} ]; then
- ALL_DIRS="${ALL_DIRS} ${dir}"
+ _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