[Piuparts-commits] [SCM] piatti.debian.org configuration files branch, piatti, updated. 148332ef45997ba3aaf38cc2c9a28441083bad49

Holger Levsen holger at layer-acht.org
Thu Dec 22 12:26:37 UTC 2011


The following commit has been merged in the piatti branch:
commit 57f5c02c353c81db423a4fe59b7fecb6916e8bbc
Author: Holger Levsen <holger at layer-acht.org>
Date:   Thu Dec 22 13:05:18 2011 +0100

    only cause output if there is meaningful output

diff --git a/home/piupartsm/bin/archive_old_logs b/home/piupartsm/bin/archive_old_logs
index 9fbc906..3696b1f 100755
--- a/home/piupartsm/bin/archive_old_logs
+++ b/home/piupartsm/bin/archive_old_logs
@@ -49,12 +49,16 @@ for SECTION in $SECTIONS ; do
 	mkdir -p archive/pass archive/bugged archive/fail
 	test -f archive/stamp || touch -d @0 archive/stamp  # start at the epoch
 	touch -d yesterday archive/stamp.new  # look back one more day the next time we will be run
+	OUTPUT=""
 	# loop through all packages logs 
 	for PACKAGE in $(find pass/ fail/ bugged/ -name '*.log' -newer archive/stamp | cut -d"_" -f1 | cut -d"/" -f2 | sort -u) ; do
 		# all logs except the last one (|sed '$d' deletes the last line)
 		OLDLOGS=$( ls -tr1 --color=none bugged/${PACKAGE}_*.log fail/${PACKAGE}_*.log pass/${PACKAGE}_*.log 2>/dev/null|sed '$d' )
 		if [ ! -z "$OLDLOGS" ] ; then
-			echo $SECTION
+			if [ -z "$OUTPUT" ] ; then
+				OUTPUT="yes"
+				echo $SECTION
+			fi
 			for LOG in $OLDLOGS ; do
 				mv -v $LOG archive/$(echo $LOG|cut -d"/" -f1)/
 			done
@@ -63,10 +67,12 @@ for SECTION in $SECTIONS ; do
 				echo keeping bugged state:
 				mv -v fail/${PACKAGE}_*.log bugged/ 2>/dev/null
 			fi
-			echo
-			echo
 		fi
 	done
+	if [ -n "$OUTPUT" ] ; then
+		echo 
+		echo
+	fi
 	mv archive/stamp.new archive/stamp
 done
 

-- 
piatti.debian.org configuration files



More information about the Piuparts-commits mailing list