[Piuparts-commits] [piuparts] 01/23: reschedule_piuparts_tests: add --dryrun option

Holger Levsen holger at layer-acht.org
Tue Jan 17 12:39:45 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 61e79c213baad99d6aeebe3f591d576a0b9e1deb
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Jan 15 22:25:02 2017 +0100

    reschedule_piuparts_tests: add --dryrun option
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 debian/changelog                        |  4 ++--
 master-bin/reschedule_piuparts_tests.in | 17 +++++++++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b47fa28..59046e4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -60,8 +60,8 @@ piuparts (0.74) unstable; urgency=medium
     longer have a Release file."
   * master-bin/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.
+  * master-bin/reschedule_piuparts_tests: New experimental 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
index 5484fc1..570b0c1 100755
--- a/master-bin/reschedule_piuparts_tests.in
+++ b/master-bin/reschedule_piuparts_tests.in
@@ -26,6 +26,7 @@ get_config_value SECTIONS global sections
 
 TESTING="stretch"
 
+dryrun=""
 current=""
 longterm=""
 pass=""
@@ -45,6 +46,10 @@ do
 			shift
 			longterm="yes"
 			;;
+		--dryrun)
+			shift
+			dryrun="yes"
+			;;
 		*)
 			break
 			;;
@@ -99,7 +104,11 @@ for SECTION in $SECTIONS ; do
 	do
 		if [ -f "$log" ] && [ ! -f "$SECTION/recycle/$(basename $log)" ]; then
 			TOTAL=$(( $TOTAL + 1 ))
-			ln -fv "$log" $SECTION/recycle/ || true
+			if [ -n "$dryrun" ]; then
+				echo "candidate: $log"
+			else
+				ln -fv "$log" $SECTION/recycle/ || true
+			fi
 		fi
 	done
 	cd "$OLDPWD"
@@ -107,5 +116,9 @@ done
 rm -f $LIST
 
 if [ "$TOTAL" -gt "0" ]; then
-	echo "Marked $TOTAL logfiles for recycling."
+	if [ -n "$dryrun" ]; then
+		echo "Found $TOTAL candidate logfiles for recycling."
+	else
+		echo "Marked $TOTAL logfiles for recycling."
+	fi
 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