[Qa-jenkins-scm] [jenkins.debian.net] 04/04: reproducible debian: simplify conditions

Holger Levsen holger at layer-acht.org
Sat Sep 9 12:26:42 UTC 2017


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

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

commit ad48e93bc2bb9d5984f87c24e5e30d0b58910106
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Fri Sep 8 11:01:53 2017 +0200

    reproducible debian: simplify conditions
    
    * at that point we already know that SAVE_ARTIFACTS=0 (well we know != 1, but
      0 is the only other value)
    * avoid nested if while still checkin for the same value
    
    pondering a `case` statement here…
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_build.sh | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index d9265fc..c252664 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -101,17 +101,16 @@ save_artifacts() {
 cleanup_all() {
 	echo "Starting cleanup."
 	if [ "$SAVE_ARTIFACTS" = "1" ] ; then
-		save_artifacts
-	elif [ "$NOTIFY" = "2" ] && [ "$SAVE_ARTIFACTS" = "0" ] ; then
+		save_artifacts  # this will also notify IRC as needed
+	elif [ "$NOTIFY" = "2" ] ; then
 		irc_message debian-reproducible "$DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE done: $STATUS debug: $NOTIFY"
-	elif [ "$NOTIFY" = "1" ] && [ "$SAVE_ARTIFACTS" = "0" ] ; then
+	elif [ "$NOTIFY" = "1" ] ; then
 		irc_message debian-reproducible "$DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE done: $STATUS"
-	elif [ ! -z "$NOTIFY" ] && [ "$SAVE_ARTIFACTS" = "0" ] ; then
-		if [ "$NOTIFY" = "diffoscope" ] ; then
+	elif [ "$NOTIFY" = "diffoscope" ] ; then
 			irc_message debian-reproducible-changes "$DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE $STATUS and $DIFFOSCOPE failed"
-		else
-			irc_message debian-reproducible-changes "$DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE done: $STATUS debug: $NOTIFY"
-		fi
+	elif [ ! -z "$NOTIFY" ] ; then
+		# a weird value of $NOTIFY that we don't know about
+		irc_message debian-reproducible-changes "$DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE done: $STATUS debug: $NOTIFY"
 	fi
 	[ ! -f $RBUILDLOG ] || gzip -9fvn $RBUILDLOG
 	if [ "$MODE" = "master" ] ; then

-- 
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