INN commit: trunk/scripts (news.daily.in)

INN Commit rra at isc.org
Fri Oct 9 16:56:08 UTC 2009


    Date: Friday, October 9, 2009 @ 09:56:07
  Author: iulius
Revision: 8651

Remove duplicate contents in news.daily, as for the run of
expire and expireover.

Also add a warning when the "lowmark" keyword is used
without "expireover".

Thanks to D. Stussy for the patch.

Modified:
  trunk/scripts/news.daily.in

---------------+
 news.daily.in |   57 +++++++++++---------------------------------------------
 1 file changed, 12 insertions(+), 45 deletions(-)

Modified: news.daily.in
===================================================================
--- news.daily.in	2009-10-03 18:00:44 UTC (rev 8650)
+++ news.daily.in	2009-10-09 16:56:07 UTC (rev 8651)
@@ -208,7 +208,10 @@
     }
 
 test -n "${LOWMARKFILE}" && {
-	EXPIREOVERFLAGS="${EXPIREOVERFLAGS} -Z${LOWMARKFILE}"
+        EXPIREOVERFLAGS="${EXPIREOVERFLAGS} -Z${LOWMARKFILE}"
+        if [ "${DOEXPIREOVER}" != "true" ] ; then
+            echo "lowmark requires expireover" >> ${EXPLOG}
+        fi
 }
 
 
@@ -301,7 +304,7 @@
     test -n "${RMFILE}" -a -s "${RMFILE}" && {
 	mv ${RMFILE} ${RMFILE}.$$ && RMFILE=${RMFILE}.$$
 
-	test -n "${TMPDIR}" && SORT="${SORT} -T ${TMPDIR}"	
+	test -n "${TMPDIR}" && SORT="${SORT} -T ${TMPDIR}"
 	${SORT} -u -o ${RMFILE} ${RMFILE}
 	if ${DOEXPLOG}; then
 	    echo "expirerm start `date`" >>${EXPLOG}
@@ -362,7 +365,7 @@
     fi
 
     ## Get rid of an old expire RMFILE since news.daily locks itself and
-    ## we would not get here if another instance were still running.       
+    ## we would not get here if another instance were still running.
     if [ -n "${RMFILE}" ] ; then
         rm -f ${RMFILE}
     fi
@@ -439,7 +442,7 @@
 case "${SERVERMODE}" in
 "Server throttled"*)
     ##  We did, try to unthrottle the server.
-    echo "${SERVERMODE} -- trying to recover"    
+    echo "${SERVERMODE} -- trying to recover"
     ctlinnd -s go ""
     ;;
 esac
@@ -455,7 +458,7 @@
     test -n "${RMFILE}" -a -s "${RMFILE}" && {
 	mv ${RMFILE} ${RMFILE}.$$ && RMFILE=${RMFILE}.$$
 
-	test -n "${TMPDIR}" && SORT="${SORT} -T ${TMPDIR}"	
+	test -n "${TMPDIR}" && SORT="${SORT} -T ${TMPDIR}"
 	${SORT} -u -o ${RMFILE} ${RMFILE}
 	if ${DOEXPLOG}; then
 	    echo "expirerm start `date`" >>${EXPLOG}
@@ -464,46 +467,10 @@
 	if ${DOEXPLOG}; then
 	    echo "expirerm end `date`" >>${EXPLOG}
 	fi
-	${DOEXPIREOVER} && {
-	    if ${DOEXPLOG}; then
-		echo "${EXPIREOVER} start `date`" >>${EXPLOG}
-	    fi
-	    ( cd ${HISTDIR} ; eval ${EXPIREOVER} "${EXPIREOVERFLAGS}" 2>&1 ) | \
-	      grep -v 'No such file or directory'
-	    DOEXPIREOVER=false
-	    if ${DOEXPLOG}; then
-		echo "${EXPIREOVER} end `date`" >>${EXPLOG}
-	    fi
-	}
-	test -n "${LOWMARKFILE}" && {
-	    echo "lowmarkrenumber begin `date`: (${LOWMARKFILE})"   >>${EXPLOG}
-	    ctlinnd -s -t`wc -l <${ACTIVE}` lowmark ${LOWMARKFILE} 2>&1
-	    echo "lowmarkrenumber end `date`"                       >>${EXPLOG}
-	    rm -f ${MOST_LOGS}/expire.lastlowmark
-	    mv ${LOWMARKFILE} ${MOST_LOGS}/expire.lastlowmark
-	}
     }
-    ##  Expire overview lines for files we just removed.
-    if ${DOEXPIREOVER}; then
-	if ${DOEXPLOG}; then
-	    echo "${EXPIREOVER} start `date`" >>${EXPLOG}
-	fi
-	( cd ${HISTDIR} ; eval ${EXPIREOVER} "${EXPIREOVERFLAGS}" 2>&1 ) | \
-	    grep -v 'No such file or directory'
-	DOEXPIREOVER=false
-	if ${DOEXPLOG}; then
-	    echo "${EXPIREOVER} end `date`" >>${EXPLOG}
-	fi
-	test -n "${LOWMARKFILE}" && {
-	    echo "lowmarkrenumber begin `date`: (${LOWMARKFILE})"   >>${EXPLOG}
-	    ctlinnd -s -t`wc -l <${ACTIVE}` lowmark ${LOWMARKFILE} 2>&1
-	    echo "lowmarkrenumber end `date`"                       >>${EXPLOG}
-	    rm -f ${MOST_LOGS}/expire.lastlowmark
-	    mv ${LOWMARKFILE} ${MOST_LOGS}/expire.lastlowmark
-	}
-    fi
 fi
-##  In case noexpire expireover.
+
+##  Remove the articles that are supposed to go from the overview.
 if ${DOEXPIREOVER}; then
     if ${DOEXPLOG}; then
 	echo "${EXPIREOVER} start `date`" >>${EXPLOG}
@@ -514,9 +481,9 @@
 	echo "${EXPIREOVER} end `date`" >>${EXPLOG}
     fi
     test -n "${LOWMARKFILE}" && {
-	echo "lowmarkrenumber begin `date`: (${LOWMARKFILE})"   >>${EXPLOG}
+	echo "lowmarkrenumber begin `date`: (${LOWMARKFILE})" >>${EXPLOG}
 	ctlinnd -s -t`wc -l <${ACTIVE}` lowmark ${LOWMARKFILE} 2>&1
-	echo "lowmarkrenumber end `date`"                           >>${EXPLOG}
+	echo "lowmarkrenumber end `date`" >>${EXPLOG}
 	rm -f ${MOST_LOGS}/expire.lastlowmark
 	mv ${LOWMARKFILE} ${MOST_LOGS}/expire.lastlowmark
     }




More information about the inn-committers mailing list