[Piuparts-commits] [piuparts] 08/08: reschedule_piuparts_tests: a helper tool for recycling piuparts logs

Holger Levsen holger at layer-acht.org
Sat Jan 14 14:39:51 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 1a65baaf3e1ffd5db7689e5db90b858e0bf6b411
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sat Jan 14 12:53:50 2017 +0100

    reschedule_piuparts_tests: a helper tool for recycling piuparts logs
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 debian/changelog                        |   2 +
 master-bin/reschedule_piuparts_tests.in | 111 ++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 50b691a..0667227 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -44,6 +44,8 @@ piuparts (0.74) UNRELEASED; urgency=medium
     Release file." to the detected issues.
   * detect_piuparts_issues: Detect 'invoke-rc.d: initscript mysql, action
     "restart" failed.'
+  * master-bin/reschedule_piuparts_tests: New helper script for rescheduling
+    piuparts tests based on detected known problems.
 
   [ Holger Levsen ]
   * Apply patch by Antonio Ospite to workaround #847788 by force-unmounting
diff --git a/master-bin/reschedule_piuparts_tests.in b/master-bin/reschedule_piuparts_tests.in
new file mode 100755
index 0000000..5484fc1
--- /dev/null
+++ b/master-bin/reschedule_piuparts_tests.in
@@ -0,0 +1,111 @@
+#!/bin/sh
+set -e
+
+# Copyright © 2013-2017 Andreas Beckmann (anbe 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, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+. @sharedir@/piuparts/lib/read_config.sh
+
+get_config_value MASTER global master-directory
+get_config_value SECTIONS global sections
+
+
+TESTING="stretch"
+
+current=""
+longterm=""
+pass=""
+
+for arg in "$@"
+do
+	case "$arg" in
+		--pass)
+			shift
+			pass="pass"
+			;;
+		--current)
+			shift
+			current="yes"
+			;;
+		--longterm)
+			shift
+			longterm="yes"
+			;;
+		*)
+			break
+			;;
+	esac
+done
+
+test -n "$1" || exit 1
+
+subdirs="$pass fail bugged affected"
+pattern=' ('"$1"')\.conf$'
+
+
+#
+# mark logs matching kpr tag $1 for recycling
+#
+TOTAL=0
+OLDPWD=$(pwd)
+LIST=$(mktemp)
+for SECTION in $SECTIONS ; do
+	test -d $MASTER/$SECTION || continue
+	go=
+	if [ -z "$current$longterm" ]; then
+		go=yes
+	else
+		case "$SECTION" in
+			# don't catch old*stable222testing
+			*$TESTING*|testing*|*sid*|*experimental*)
+				if [ "$current" = "yes" ]; then
+					go=yes
+				fi
+				;;
+			*222testing*)
+				if [ "$longterm" = "yes" ]; then
+					go=yes
+				fi
+				;;
+		esac
+	fi
+	if [ "$go" != "yes" ]; then
+		echo "Skip: $SECTION"
+		continue
+	fi
+	cd $MASTER
+	searchdirs=""
+	for dir in $subdirs ; do
+		searchdirs="$searchdirs $SECTION/$dir"
+	done
+	mkdir -p $searchdirs $SECTION/recycle
+
+	grep -rlE "$pattern" --include '*.kpr' $searchdirs | sed 's/\.kpr$/.log/' > $LIST
+	for log in $(cat $LIST)
+	do
+		if [ -f "$log" ] && [ ! -f "$SECTION/recycle/$(basename $log)" ]; then
+			TOTAL=$(( $TOTAL + 1 ))
+			ln -fv "$log" $SECTION/recycle/ || true
+		fi
+	done
+	cd "$OLDPWD"
+done
+rm -f $LIST
+
+if [ "$TOTAL" -gt "0" ]; then
+	echo "Marked $TOTAL logfiles for recycling."
+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