rpms/spamassassin/devel sa-update.cronscript,1.10,1.11

Warren Togami 砥上勇 wtogami at fedoraproject.org
Sun Jan 24 20:20:58 UTC 2010


Author: wtogami

Update of /cvs/pkgs/rpms/spamassassin/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12472

Modified Files:
	sa-update.cronscript 
Log Message:
Simplify for loop, handle .conf files with spaces in them (although why would anyone do that?)



Index: sa-update.cronscript
===================================================================
RCS file: /cvs/pkgs/rpms/spamassassin/devel/sa-update.cronscript,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- sa-update.cronscript	24 Jan 2010 20:07:16 -0000	1.10
+++ sa-update.cronscript	24 Jan 2010 20:20:58 -0000	1.11
@@ -26,7 +26,8 @@ fi
 CHANNELLIST=""
 KEYLIST=""
 # Process each channel defined in /etc/mail/spamassassin/channel.d/
-for file in $(find -L /etc/mail/spamassassin/channel.d/ -mindepth 1 -maxdepth 1 -type f -name '*.conf'); do
+for file in /etc/mail/spamassassin/channel.d/*.conf; do
+    [ ! -f "$file" ] && continue
     # Validate config file
     PREFIXES="CHANNELURL KEYID BEGIN"
     for prefix in $PREFIXES; do
@@ -35,12 +36,12 @@ for file in $(find -L /etc/mail/spamassa
             exit 255
         fi
     done
-    . $file
-    #echo "CHANNELURL=$CHANNELURL"
-    #echo "KEYID=$KEYID"
+    . "$file"
+    echo "CHANNELURL=$CHANNELURL"
+    echo "KEYID=$KEYID"
     CHANNELLIST="$CHANNELLIST $CHANNELURL"
     KEYLIST="$KEYLIST $KEYID"
-    sa-update --import $file
+    sa-update --import "$file"
 done
 
 # Sleep random amount of time before proceeding to avoid overwhelming the servers



More information about the scm-commits mailing list