[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] jenkins nodes: when checking for apt updates, ignore linux-image(s) if linux-image is on hold

Holger Levsen (@holger) gitlab at salsa.debian.org
Wed Jun 14 10:34:29 BST 2023



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
9872669e by Holger Levsen at 2023-06-14T11:33:57+02:00
jenkins nodes: when checking for apt updates, ignore linux-image(s) if linux-image is on hold

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

- - - - -


1 changed file:

- bin/reproducible_maintenance.sh


Changes:

=====================================
bin/reproducible_maintenance.sh
=====================================
@@ -902,11 +902,25 @@ fi
 #
 echo "$(date -u) - Checking for system updates."
 sudo apt-get update || true # maybe it's better to do force this running in the presence...
-if [ $(apt list --upgradable 2>/dev/null | wc -l) -gt 1 ] ; then
-	echo "Warning: there are packages to be upgraded on this system."
-	apt list --upgradable 2>/dev/null
-	DIRTY=true
+TMPFILE=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXXXX)
+apt list --upgradable 2>/dev/null > $TMPFILE
+if [ $(cat $TMPFILE | wc -l) -gt 1 ] ; then
+	if ( $(dpkg -l |grep linux-image | grep -q ^hi) && [ $(cat $TMPFILE | grep -v linux-image | wc -l) -gt 1 ] ) \
+		|| ( ! $(dpkg -l |grep linux-image | grep -q ^hi) && [ $(cat $TMPFILE | wc -l) -gt 1 ] ) ; then
+		echo "Warning: there are packages to be upgraded on this system."
+		DIRTY=true
+		cat $TMPFILE
+		if $(dpkg -l |grep linux-image | grep -q ^hi) ; then
+			echo "Note: linux-image is on hold:"
+			dpkg -l |grep linux-image | grep ^hi
+		fi
+	else
+		echo "Note: there is linux-image to be upgraded on this system, but linux-image is on hold:"
+		cat $TMPFILE
+		dpkg -l |grep linux-image | grep ^hi
+	fi
 fi
+rm -f $TMPFILE
 
 if ! $DIRTY ; then
 	echo "$(date -u ) - Everything seems to be fine."



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/9872669e3063eca9b5d8a055e6083ffefdcc1387

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/9872669e3063eca9b5d8a055e6083ffefdcc1387
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/qa-jenkins-scm/attachments/20230614/090f8c3b/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list