summaryrefslogtreecommitdiff
path: root/mail/cyrus-imapd21
diff options
context:
space:
mode:
authorjlam <jlam>2004-07-31 03:29:38 +0000
committerjlam <jlam>2004-07-31 03:29:38 +0000
commitf165a9ed0d6964175bcb4eb7f8843a437e5f75c0 (patch)
tree17bd91fce02cc791da7918f8a11d48c965560389 /mail/cyrus-imapd21
parent5dca78fc3b9bcdf1afc8ff0cb7ac4d31dadc7cbd (diff)
downloadpkgsrc-f165a9ed0d6964175bcb4eb7f8843a437e5f75c0.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-imapd21')
-rw-r--r--mail/cyrus-imapd21/files/cyrus.sh24
1 files changed, 11 insertions, 13 deletions
diff --git a/mail/cyrus-imapd21/files/cyrus.sh b/mail/cyrus-imapd21/files/cyrus.sh
index 372129727d9..e556f55ca48 100644
--- a/mail/cyrus-imapd21/files/cyrus.sh
+++ b/mail/cyrus-imapd21/files/cyrus.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: cyrus.sh,v 1.2 2003/02/27 13:21:52 seb Exp $
+# $NetBSD: cyrus.sh,v 1.3 2004/07/31 03:29:38 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"