[Piuparts-commits] [piuparts] 17/20: reschedule_oldest_logs: report counts of logs in recycle/

Holger Levsen holger at moszumanska.debian.org
Sat Nov 23 20:23:35 UTC 2013


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit 8957b4f276b24a3423e55d7f38bc7131d0276e05
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Nov 17 12:38:19 2013 +0100

    reschedule_oldest_logs: report counts of logs in recycle/
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 debian/changelog                     |  1 +
 master-bin/reschedule_oldest_logs.in | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 89c19dc..1937cb0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,7 @@ piuparts (0.56) UNRELEASED; urgency=low
     generate fatal errors.
   * Add support for new adequate tags missing-symbol-version-information and
     symbol-size-mismatch.
+  * reschedule_oldest_logs: Report number of logfiles in recycle/.
 
  -- Andreas Beckmann <anbe at debian.org>  Tue, 22 Oct 2013 22:16:21 +0200
 
diff --git a/master-bin/reschedule_oldest_logs.in b/master-bin/reschedule_oldest_logs.in
index 489ddde..183e6b7 100755
--- a/master-bin/reschedule_oldest_logs.in
+++ b/master-bin/reschedule_oldest_logs.in
@@ -54,10 +54,12 @@ list_logs()
 TOTAL=0
 TOTAL_EXPIRED=0
 UNSCHEDULE=0
+TOTAL_QUEUED=0
 LOGS=$(mktemp)
 OBSOLETE=$(mktemp)
 EXPIRED=$(mktemp)
 UNSORTED=$(mktemp)
+QUEUED=$(mktemp)
 OLDPWD=$(pwd)
 for SECTION in $SECTIONS ; do
 	test -d $MASTER/$SECTION || continue
@@ -103,8 +105,9 @@ for SECTION in $SECTIONS ; do
 			test -f "recycle/${log#*/}" || echo "$log"
 		done > $LOGS
 	fi
+	find recycle/ -name '*.log' > $QUEUED
 
-	if [ -s $LOGS ] || [ -s $OBSOLETE ] || [ -s $EXPIRED ]; then
+	if [ -s $LOGS ] || [ -s $OBSOLETE ] || [ -s $EXPIRED ] || [ -s $QUEUED ] ; then
 		RCOUNT=$(wc -l $LOGS | awk '{ print $1 }')
 		TOTAL=$(($TOTAL + $RCOUNT))
 		ECOUNT=$(wc -l $EXPIRED | awk '{ print $1 }')
@@ -123,6 +126,10 @@ for SECTION in $SECTIONS ; do
 		if [ -s $OBSOLETE ]; then
 			rm -fv $(cat $OBSOLETE)
 		fi
+		find recycle/ -name '*.log' > $QUEUED
+		NUM_QUEUED=$(wc -l < $QUEUED)
+		TOTAL_QUEUED=$(($TOTAL_QUEUED + $NUM_QUEUED))
+		echo "queued: $NUM_QUEUED"
 		echo
 		echo "#########################################################"
 		echo
@@ -133,6 +140,7 @@ rm $LOGS
 rm $OBSOLETE
 rm $EXPIRED
 rm $UNSORTED
+rm $QUEUED
 
 if [ "$TOTAL" -gt "0" ]; then
 	echo "Rescheduled $TOTAL logs."
@@ -143,3 +151,6 @@ fi
 if [ "$UNSCHEDULE" -gt "0" ]; then
 	echo "Cancelled $UNSCHEDULE outdated rescheduling requests."
 fi
+if [ "$TOTAL_QUEUED" -gt "0" ]; then
+	echo "Queued logs: $TOTAL_QUEUED"
+fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list