[Piuparts-commits] [piuparts] 02/03: refactor detect_archive_issues

Holger Levsen holger at layer-acht.org
Wed Mar 15 21:52:59 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 8fd9b293abcd629daf5345997625b410364d5a66
Author: Andreas Beckmann <anbe at debian.org>
Date:   Wed Mar 15 21:27:30 2017 +0100

    refactor detect_archive_issues
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 master-bin/detect_archive_issues.in | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/master-bin/detect_archive_issues.in b/master-bin/detect_archive_issues.in
index 03296da..a08d24a 100755
--- a/master-bin/detect_archive_issues.in
+++ b/master-bin/detect_archive_issues.in
@@ -25,6 +25,8 @@ 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"
+
 STARTDATE=$(date -u +%s)
 
 #
@@ -35,6 +37,7 @@ LOGS=`mktemp`
 URLS=`mktemp`
 for SECTION in $SECTIONS ; do
 	test -d $MASTER/$SECTION || continue
+	URL_SED="s#$MASTER/$SECTION/fail#$URLBASE/$SECTION/untestable#"
 	mkdir -p $MASTER/$SECTION/fail/ $MASTER/$SECTION/untestable/
 	# '-mtime +0' actually means '24 hours or older'
 	find $MASTER/$SECTION/fail -name '*.log' -mtime +0 | xargs -r \
@@ -44,12 +47,12 @@ for SECTION in $SECTIONS ; do
 		do
 			mv $package_log $MASTER/$SECTION/untestable/
 		done
-		sed "s#$MASTER/$SECTION/fail#$URLBASE/$SECTION/untestable#" $LOGS >> $URLS
+		sed "$URL_SED" $LOGS >> $URLS
 	fi
 done
 if [ -s $URLS ]; then
-	date >> $MASTER/archive_issues.txt
-	cat $URLS >> $MASTER/archive_issues.txt
+	date >> $ISSUE_LOG
+	cat $URLS >> $ISSUE_LOG
 	FINALDATE=$(date -u +%s)
 	RUNTIME=$(date -u -d "0 $FINALDATE seconds - $STARTDATE seconds" +%T)
 	echo "Runtime: $RUNTIME"
@@ -70,7 +73,7 @@ if [ -s $URLS ]; then
 	echo "If it is always the same package failing, it's likely to be an issue in the"
 	echo "package."
 	echo
-	grep -f $URLS $MASTER/archive_issues.txt | sort | uniq -c | sort -rn
+	grep -f $URLS $ISSUE_LOG | sort | uniq -c | sort -rn
 	echo
 fi
 rm $LOGS $URLS

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