[Piuparts-devel] [Git][debian/piuparts][develop] WIP: reduce number of mails per day, from currently 34 down to 32 - see #912591

Holger Levsen gitlab at salsa.debian.org
Tue Nov 27 18:23:38 GMT 2018


Holger Levsen pushed to branch develop at Debian / piuparts


Commits:
8a4671ed by Holger Levsen at 2018-11-27T18:22:58Z
WIP: reduce number of mails per day, from currently 34 down to 32 - see #912591

  - master-bin/detect_archive_issues: redirect logs to htdocs/logs to spare
    us two mails per day.
  - lib/write_log.sh: new helper to publish logs in htdocs/logs.

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


3 changed files:

- debian/changelog
- + lib/write_log.sh
- master-bin/detect_archive_issues.in


Changes:

=====================================
debian/changelog
=====================================
@@ -2,6 +2,10 @@ piuparts (0.95) UNRELEASED; urgency=medium
 
   * piuparts.py: add /var/lib/debian-security-support/ to self.ignored_files.
     (Closes: #749317)
+  * WIP: reduce number of mails per day, from currently 34 down to? see #912591
+    - master-bin/detect_archive_issues: redirect logs to htdocs/logs to spare
+      us two mails per day.
+    - lib/write_log.sh: new helper to publish logs in htdocs/logs.
 
  -- Holger Levsen <holger at debian.org>  Thu, 08 Nov 2018 12:12:21 +0100
 


=====================================
lib/write_log.sh
=====================================
@@ -0,0 +1,31 @@
+# Copyright © 2018 Holger Levsen (holger at debian.org)
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <https://www.gnu.org/licenses/>
+
+#
+# Helper function for publishing logfiles
+#
+
+publish_logs() {
+	local TEMPORARY_OUTPUT=$1
+	local HTDOCS="$2"
+	local LOG=$3
+	local YEAR=$(date -u +%Y)
+	local MONTH=$(date -u +%M)
+	local DAY=$(date -u +%d)
+	local DIR="$HTDOCS/logs/$YEAR/$MONTH/$DAY"
+	mkdir -p "$DIR"
+	cat $TEMPORARY_OUTPUT >> "$DIR/$LOG.txt"
+	rm -f $TEMPORARY_OUTPUT >/dev/null
+}


=====================================
master-bin/detect_archive_issues.in
=====================================
@@ -18,13 +18,16 @@
 
 
 . @sharedir@/piuparts/lib/read_config.sh
+. @sharedir@/piuparts/lib/write_log.sh
 
 get_config_value MASTER global master-directory
+get_config_value HTDOCS global output-directory
 get_config_value SECTIONS global sections
 get_config_value URLBASE global urlbase https://piuparts.debian.org
 get_config_value DAYS global reschedule-untestable-days 7
 
 ISSUE_LOG="$MASTER/archive_issues.txt"
+TEMPORARY_OUTPUT=`mktemp`
 
 STARTDATE=$(date -u +%s)
 
@@ -59,21 +62,26 @@ if [ -s $URLS ]; then
 	cat $URLS >> $ISSUE_LOG
 	FINALDATE=$(date -u +%s)
 	RUNTIME=$(date -u -d "0 $FINALDATE seconds - $STARTDATE seconds" +%T)
-	echo "Runtime: $RUNTIME"
-	echo
-	echo "Broken packages detected! The following packages have been moved to"
-	echo "$section/untestable and will be tested again in $DAYS days."
-	echo
-	echo "Broken packages are usually a temporary problem in the archive and are"
-	echo "caught by other tools like britney or https://qa.debian.org/dose/debcheck.html"
-	echo "If it is always the same package failing, it's likely to be an issue in the"
-	echo "package."
-	echo
-	grep -f $URLS $ISSUE_LOG | sort | uniq -c | sort -rn
-	echo
-	echo "Those problems were found in failed logs by grep'ing for these patterns:"
-	echo "        'E: Broken packages'"
-	echo "        'E: Unable to correct problems, you have held broken packages'"
-	echo "        'E: Error, pkgProblemResolver::Resolve generated breaks'"
+	(
+		echo "$(date -u)"
+		echo "Runtime: $RUNTIME"
+		echo
+		echo "Broken packages detected! The following packages have been moved to"
+		echo "$section/untestable and will be tested again in $DAYS days."
+		echo
+		echo "Broken packages are usually a temporary problem in the archive and are"
+		echo "caught by other tools like britney or https://qa.debian.org/dose/debcheck.html"
+		echo "If it is always the same package failing, it's likely to be an issue in the"
+		echo "package."
+		echo
+		grep -f $URLS $ISSUE_LOG | sort | uniq -c | sort -rn
+		echo
+		echo "Those problems were found in failed logs by grep'ing for these patterns:"
+		echo "        'E: Broken packages'"
+		echo "        'E: Unable to correct problems, you have held broken packages'"
+		echo "        'E: Error, pkgProblemResolver::Resolve generated breaks'"
+		echo
+	) > $TEMPORARY_OUTPUT
+	publish_logs $TEMPORARY_OUTPUT $HTDOCS archive_issues
 fi
 rm $LOGS $URLS



View it on GitLab: https://salsa.debian.org/debian/piuparts/commit/8a4671ed3ae6f75602c5c839cbc6626d38c24ce9

-- 
View it on GitLab: https://salsa.debian.org/debian/piuparts/commit/8a4671ed3ae6f75602c5c839cbc6626d38c24ce9
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/piuparts-devel/attachments/20181127/55b62e05/attachment-0001.html>


More information about the Piuparts-devel mailing list