summaryrefslogtreecommitdiff
path: root/mail/cyrus-imapd22
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-05-27 04:45:06 +0000
committerjlam <jlam@pkgsrc.org>2004-05-27 04:45:06 +0000
commit99cface08bd4a998e5f5c67b2afd00c2a73be7d7 (patch)
tree92bfd4ed75124f7118b3deb5eeae47621c68b759 /mail/cyrus-imapd22
parentcc1121c7445d7d8855c3d8ceb8f09795d29ebf80 (diff)
downloadpkgsrc-99cface08bd4a998e5f5c67b2afd00c2a73be7d7.tar.gz
Restructure the flow so that we use pipes to pass information between
processes instead of saving values in shell variables and then iterating over them. Using pipes is more scalable and is just as easy to read, so it's a net win.
Diffstat (limited to 'mail/cyrus-imapd22')
-rw-r--r--mail/cyrus-imapd22/DEINSTALL16
-rw-r--r--mail/cyrus-imapd22/files/cyrus.sh24
2 files changed, 18 insertions, 22 deletions
diff --git a/mail/cyrus-imapd22/DEINSTALL b/mail/cyrus-imapd22/DEINSTALL
index 4a6e8c32874..2ad34812c72 100644
--- a/mail/cyrus-imapd22/DEINSTALL
+++ b/mail/cyrus-imapd22/DEINSTALL
@@ -1,18 +1,16 @@
-# $NetBSD: DEINSTALL,v 1.1.1.1 2004/01/18 12:42:11 recht Exp $
+# $NetBSD: DEINSTALL,v 1.2 2004/05/27 04:45:06 jlam Exp $
IMAPDCONF=@IMAPDCONF@
case ${STAGE} in
DEINSTALL)
if [ -f ${IMAPDCONF} ]; then
- imap_dirs=` \
- ${AWK} '/configdirectory:/ { print $2 }; \
- /partition-.*:/ { print $2 }; \
- /sievedir:/ { print $2 }' \
- ${IMAPDCONF} \
- `
- for dir in ${imap_dirs}; do
- if [ -d ${dir} ]; 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}"
fi
done
diff --git a/mail/cyrus-imapd22/files/cyrus.sh b/mail/cyrus-imapd22/files/cyrus.sh
index 1f34b4cb443..e618c464b39 100644
--- a/mail/cyrus-imapd22/files/cyrus.sh
+++ b/mail/cyrus-imapd22/files/cyrus.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: cyrus.sh,v 1.1.1.1 2004/01/18 12:42:12 recht Exp $
+# $NetBSD: cyrus.sh,v 1.2 2004/05/27 04:45:06 jlam Exp $
#
# PROVIDE: cyrus
# REQUIRE: DAEMON
@@ -50,18 +50,16 @@ cyrus_mkimap()
{
# Generate the prerequisite directory structure for Cyrus IMAP.
if [ -f @IMAPDCONF@ ]; then
- imap_dirs=`
- @AWK@ '/^configdirectory:/ { print $2 }; \
- /^partition-.*:/ { print $2 }; \
- /^sievedir:/ { print $2 }' \
- @IMAPDCONF@ \
- `
- for dir in ${imap_dirs}; do
- if [ ! -d ${dir} ]; then
- @MKDIR@ ${dir}
- @CHMOD@ 750 ${dir}
- @CHOWN@ @CYRUS_USER@ ${dir}
- @CHGRP@ @CYRUS_GROUP@ ${dir}
+ @AWK@ '/^configdirectory:/ { print $2 }; \
+ /^partition-.*:/ { print $2 }; \
+ /^sievedir:/ { print $2 }' \
+ @IMAPDCONF@ | \
+ while read dir; do
+ if [ ! -d "$dir" ]; then
+ @MKDIR@ "$dir"
+ @CHMOD@ 750 "$dir"
+ @CHOWN@ @CYRUS_USER@ "$dir"
+ @CHGRP@ @CYRUS_GROUP@ "$dir"
fi
done
@SU@ -m @CYRUS_USER@ -c "@PREFIX@/cyrus/bin/mkimap"