pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/cyrus-imapd22 Restructure the flow so that we use...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9a89278d0fa1
branches:  trunk
changeset: 475816:9a89278d0fa1
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu May 27 04:45:06 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-imapd22/DEINSTALL      |  16 +++++++---------
 mail/cyrus-imapd22/files/cyrus.sh |  24 +++++++++++-------------
 2 files changed, 18 insertions(+), 22 deletions(-)

diffs (69 lines):

diff -r 550f7eef1f53 -r 9a89278d0fa1 mail/cyrus-imapd22/DEINSTALL
--- a/mail/cyrus-imapd22/DEINSTALL      Thu May 27 04:42:46 2004 +0000
+++ b/mail/cyrus-imapd22/DEINSTALL      Thu May 27 04:45:06 2004 +0000
@@ -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 -r 550f7eef1f53 -r 9a89278d0fa1 mail/cyrus-imapd22/files/cyrus.sh
--- a/mail/cyrus-imapd22/files/cyrus.sh Thu May 27 04:42:46 2004 +0000
+++ b/mail/cyrus-imapd22/files/cyrus.sh Thu May 27 04:45:06 2004 +0000
@@ -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 @@
 {
        # 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