pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mail/cyrus-imapd21/files Restructure the flow so that ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/fead71d7e11c
branches: trunk
changeset: 478842:fead71d7e11c
user: jlam <jlam%pkgsrc.org@localhost>
date: Sat Jul 31 03:29:38 2004 +0000
description:
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:
mail/cyrus-imapd21/files/cyrus.sh | 24 +++++++++++-------------
1 files changed, 11 insertions(+), 13 deletions(-)
diffs (40 lines):
diff -r 4c222b778981 -r fead71d7e11c mail/cyrus-imapd21/files/cyrus.sh
--- a/mail/cyrus-imapd21/files/cyrus.sh Sat Jul 31 03:28:32 2004 +0000
+++ b/mail/cyrus-imapd21/files/cyrus.sh Sat Jul 31 03:29:38 2004 +0000
@@ -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 @@
{
# 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"
Home |
Main Index |
Thread Index |
Old Index