[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] fix e5d2db0b: sometimes we do need to test for empty strings not undefined variables

Holger Levsen gitlab at salsa.debian.org
Fri Nov 20 13:03:48 GMT 2020



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


Commits:
2da03f32 by Holger Levsen at 2020-11-20T14:03:37+01:00
fix e5d2db0b: sometimes we do need to test for empty strings not undefined variables

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

- - - - -


1 changed file:

- bin/common-functions.sh


Changes:

=====================================
bin/common-functions.sh
=====================================
@@ -179,8 +179,8 @@ publish_changes_to_userContent() {
 	echo "Extracting contents from .deb files..."
 	CHANGES=$1
 	CHANNEL=$2
-	SRCPKG=$(basename $CHANGES | cut -d "_" -f1)
-	if [ "${SRCPKG+x}" != "x" ] ; then
+	SRCPKG="$(basename $CHANGES | cut -d "_" -f1)"
+	if [ -z "$SRCPKG" ] ; then
 		echo '$SRCPKG is empty, exiting with error.'
 		exit 1
 	fi
@@ -220,8 +220,8 @@ jenkins_zombie_check() {
 	# and we dont know why and when that happens,
 	# so just report those zombies here.
 	#
-	ZOMBIES=$(ls -1d /var/lib/jenkins/jobs/* | egrep 'strip-nondeterminism|reprotest|reproducible_(builder_(amd64|i386|armhf|arm64)|setup_(pbuilder|schroot)_testing)|chroot-installation_wheezy|aptdpkg|reproducible_*(odc2a|odxu4c|opi2b)|stretch_install_education-thin-client-server|jessie_multiarch_versionskew|dpkg_stretch_find_trigger_cycles|sid_install_education-services|buster_install_education-services|lvc|chroot-installation_stretch_.*_upgrade_to_sid|piuparts_.*_jessie|udd_stretch|d-i_pu-build|debsums-tests_stretch|debian-archive-keyring-tests_stretch|chroot-installation_jessie|chroot-installation_.*education-lang-|kirkwoot|rebootstrap_.*_gcc[5-8]($|_)|brcm47xx|rebootstrap_kfreebsd|diffoscope_from_git_|disorderfs_from_git_master|diffoscope_pypi|diffoscope_freebsd|diffoscope_netbsd|diffoscope_macports|diffoscope_archlinux|openwrt-target-ath97|profitbricks' || true)
-	if [ "${ZOMBIES+x}" = "x" ] ; then
+	ZOMBIES="$(ls -1d /var/lib/jenkins/jobs/* | egrep 'strip-nondeterminism|reprotest|reproducible_(builder_(amd64|i386|armhf|arm64)|setup_(pbuilder|schroot)_testing)|chroot-installation_wheezy|aptdpkg|reproducible_*(odc2a|odxu4c|opi2b)|stretch_install_education-thin-client-server|jessie_multiarch_versionskew|dpkg_stretch_find_trigger_cycles|sid_install_education-services|buster_install_education-services|lvc|chroot-installation_stretch_.*_upgrade_to_sid|piuparts_.*_jessie|udd_stretch|d-i_pu-build|debsums-tests_stretch|debian-archive-keyring-tests_stretch|chroot-installation_jessie|chroot-installation_.*education-lang-|kirkwoot|rebootstrap_.*_gcc[5-8]($|_)|brcm47xx|rebootstrap_kfreebsd|diffoscope_from_git_|disorderfs_from_git_master|diffoscope_pypi|diffoscope_freebsd|diffoscope_netbsd|diffoscope_macports|diffoscope_archlinux|openwrt-target-ath97|profitbricks' || true)"
+	if [ ! -z "$ZOMBIES" ] ; then
 		DIRTY=true
 		figlet 'zombies!!!'
 		echo "Warning, rise of the jenkins job zombies has started again, these jobs should not exist:"
@@ -238,13 +238,13 @@ jenkins_logsize_check() {
 	# /var/log/jenkins/jenkins.log sometimes grows very fast
 	# and we don't yet know why, so let's monitor this for now.
 	JENKINSLOG="$(find /var/log/jenkins -name jenkins.log -size +42G)"
-	if [ "${JENKINSLOG+x}" != "x" ] ; then
+	if [ ! -z "$JENKINSLOG" ] ; then
 		figlet 'jenkins.log size'
 		echo "Warning, jenkins.log is larger than 42G, please fix, erroring out now."
 		exit 1
 	else
 		JENKINSLOG="$(find /var/log/jenkins -name jenkins.log -size +23G)"
-		if [ "${JENKINSLOG+x}" != "x" ] ; then
+		if [ ! -z "$JENKINSLOG" ] ; then
 			DIRTY=true
 			figlet 'jenkins.log size'
 			echo "Warning, jenkins.log is larger than 23G, please do something…"



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/2da03f3241f33e5dfe5f24cd1d3178c24e711aeb
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/20201120/3d6003f6/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list