small variable naming problem in news.daily

S.P.Zeidler spz at serpens.de
Wed Dec 16 21:52:14 UTC 2009


Hi,

proposed patch:

----------------------------------------------------------------------------
--- ./scripts/news.daily.in.orig        2009-10-12 20:24:04.000000000 +0200
+++ ./scripts/news.daily.in
@@ -232,17 +232,17 @@ then
     cd "${PATHSPOOL}/${INNFEEDSPOOL}"
 
     # Find the PIDs of innfeed.
-    LOCKS=`cat *.lock 2>/dev/null | ${SORT} -u`
+    INNFEEDLOCKS=`cat *.lock 2>/dev/null | ${SORT} -u`
 
     # Process files like "innfeed-dropped.A001703" where
-    # 1703 is not in $LOCKS.
+    # 1703 is not in $INNFEEDLOCKS.
     for file in `find . -name "innfeed-dropped*" -print`
     do
         PID=`echo "$file" | ${SED} 's/^.*[A-Z]0*//'`
         FOUND=false
-        for LOCK in $LOCKS
+        for INNFEEDLOCK in $INNFEEDLOCKS
         do
-            if [ "$PID" = "$LOCK" ]
+            if [ "$PID" = "$INNFEEDLOCK" ]
             then
                 FOUND=true
             fi
----------------------------------------------------------------------------

otherwise 'for LOCK in $LOCKS' sets $LOCK which has amusing effects at

##  Lock out others.
trap 'rm -f ${LOCK} ; exit 1' 1 2 3 15 
shlock -p $$ -f ${LOCK} || {
    ( echo "$0: Locked by `cat ${LOCK}`"; ${INNSTAT} ) | eval ${MAIL}
    exit 1
}

somewhat later in the script. Also I'd suggest not to overwrite LOCKS from
/usr/pkg/lib/innshellvars just in case someone in the future expects it to
have the value in innshellvars in the entire script.

regards,
	spz
-- 
spz at serpens.de (S.P.Zeidler)



More information about the inn-workers mailing list