[Qa-jenkins-scm] [jenkins.debian.net] 01/03: reproducible debian: move cleanup_schroot_sessions() from common-functions to _mainteanance, as it's used only there now

Mattia Rizzolo mattia at debian.org
Thu Apr 5 09:40:56 UTC 2018


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

mattia pushed a commit to branch master
in repository jenkins.debian.net.

commit 07dd6e0e51f68dc308221caff0a7836ba52f1664
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Thu Apr 5 11:06:08 2018 +0200

    reproducible debian: move cleanup_schroot_sessions() from common-functions to _mainteanance, as it's used only there now
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 bin/common-functions.sh         | 26 --------------------------
 bin/reproducible_maintenance.sh | 26 +++++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/bin/common-functions.sh b/bin/common-functions.sh
index de7e15d..0c8878e 100755
--- a/bin/common-functions.sh
+++ b/bin/common-functions.sh
@@ -224,29 +224,3 @@ publish_changes_to_userContent() {
 		kgb-client --conf /srv/jenkins/kgb/$CHANNEL.conf --relay-msg "$MESSAGE"
 	fi
 }
-
-cleanup_schroot_sessions() {
-	echo
-	local RESULT=""
-	for loop in $(seq 0 40) ; do
-		# first, check if no process using "schroot" is running, if thats the case, loop through all schroot sessions:
-		# arch sessions are ignored, because they are handled properly
-		pgrep -f "schroot --directory" || for i in $(schroot --all-sessions -l |grep -v "session:archlinux"||true) ; do
-			# then, check that schroot is still not run, and then delete the session
-			if [ -z $i ] ; then
-				continue
-			fi
-			pgrep -f "schroot --directory" || schroot -e -c $i
-		done
-		RESULT=$(schroot --all-sessions -l|grep -v "session:archlinux"||true)
-		if [ -z "$RESULT" ] ; then
-			echo "No schroot sessions in use atm..."
-			echo
-			break
-		fi
-		echo "$(date -u) - schroot session cleanup loop $loop"
-		sleep 15
-	done
-	echo
-}
-
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index c6d4869..94f5e2f 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # Copyright 2014-2017 Holger Levsen <holger at layer-acht.org>
-#         © 2015-2017 Mattia Rizzolo <mattia at mapreri.org>
+#         © 2015-2018 Mattia Rizzolo <mattia at debian.org>
 # released under the GPLv=2
 
 DEBUG=false
@@ -187,6 +187,30 @@ fi
 
 # remove old and unused schroot sessions
 echo "$(date -u) - Removing unused schroot sessions."
+cleanup_schroot_sessions() {
+       echo
+       local RESULT=""
+       for loop in $(seq 0 40) ; do
+               # first, check if no process using "schroot" is running, if thats the case, loop through all schroot sessions:
+               # arch sessions are ignored, because they are handled properly
+               pgrep -f "schroot --directory" || for i in $(schroot --all-sessions -l |grep -v "session:archlinux"||true) ; do
+                       # then, check that schroot is still not run, and then delete the session
+                       if [ -z $i ] ; then
+                               continue
+                       fi
+                       pgrep -f "schroot --directory" || schroot -e -c $i
+               done
+               RESULT=$(schroot --all-sessions -l|grep -v "session:archlinux"||true)
+               if [ -z "$RESULT" ] ; then
+                       echo "No schroot sessions in use atm..."
+                       echo
+                       break
+               fi
+               echo "$(date -u) - schroot session cleanup loop $loop"
+               sleep 15
+       done
+       echo
+}
 cleanup_schroot_sessions
 
 # find old schroots

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list