[Piuparts-commits] [piuparts] 01/01: generate_daily_report.in: only add runtime to external script output if not already included.

Holger Levsen holger at layer-acht.org
Tue Mar 21 12:17:16 UTC 2017


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

holger pushed a commit to branch develop
in repository piuparts.

commit 2fbdcd668d7fbe72f199ec40e7e0ae736f295fff
Author: Holger Levsen <holger at layer-acht.org>
Date:   Tue Mar 21 13:16:51 2017 +0100

    generate_daily_report.in: only add runtime to external script output if not already included.
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 debian/changelog                    | 2 ++
 master-bin/generate_daily_report.in | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ec4bb99..bc80673 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -42,6 +42,8 @@ piuparts (0.77) UNRELEASED; urgency=medium
   * update TODO. Work on buster has begun. \o/ 
   * piuparts-report.py:
     - update navigation to point to piuparts.conf-template.pejacevic.
+  * generate_daily_report.in: only add runtime to external script output if
+    not already included.
 
  -- Andreas Beckmann <anbe at debian.org>  Sun, 12 Mar 2017 23:30:21 +0100
 
diff --git a/master-bin/generate_daily_report.in b/master-bin/generate_daily_report.in
index 7d3c673..e7d8fa4 100755
--- a/master-bin/generate_daily_report.in
+++ b/master-bin/generate_daily_report.in
@@ -47,8 +47,12 @@ for SCRIPT in detect_network_issues detect_piuparts_issues archive_old_logs repo
   @sharedir@/piuparts/master/$SCRIPT 2>&1 > $OUTPUT
   FINALDATE=$(date -u +%s)
   if [ -s $OUTPUT ] ; then
-	RUNTIME=$(date -u -d "0 $FINALDATE seconds - $STARTDATE seconds" +%T)
-	( echo "Runtime: $RUNTIME" ; echo ; cat $OUTPUT ) | mail -s $SCRIPT $LOGNAME
+	if grep -q "Runtime: " $OUTPUT ; then
+		cat $OUTPUT | mail -s $SCRIPT $LOGNAME
+	else
+		RUNTIME=$(date -u -d "0 $FINALDATE seconds - $STARTDATE seconds" +%T)
+		( echo "Runtime: $RUNTIME" ; echo ; cat $OUTPUT ) | mail -s $SCRIPT $LOGNAME
+	fi
   fi
 done
 rm $OUTPUT

-- 
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