[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible: fix diffoscope on MacPorts check

Holger Levsen gitlab at salsa.debian.org
Tue Sep 25 19:49:51 BST 2018


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


Commits:
2af0e998 by Holger Levsen at 2018-09-25T18:49:38Z
reproducible: fix diffoscope on MacPorts check

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

- - - - -


1 changed file:

- bin/diffoscope_distribution_test.sh


Changes:

=====================================
bin/diffoscope_distribution_test.sh
=====================================
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# Copyright 2014-2016 Holger Levsen <holger at layer-acht.org>
+# Copyright 2014-2018 Holger Levsen <holger at layer-acht.org>
 # released under the GPLv=2
 
 DEBUG=false
@@ -40,6 +40,31 @@ check_pypi() {
 	fi
 }
 
+check_github_macports() {
+	TMPPORT=$(mktemp -t diffoscope-distribution-XXXXXXXX)
+	# the following two lines are a bit fragile…
+	curl https://raw.githubusercontent.com/macports/macports-ports/master/sysutils/diffoscope/Portfile -o $TMPPORT
+	DIFFOSCOPE_IN_MACPORTS=$(grep ^version $TMPPORT | sed -E 's#version( )+##' )
+	rm -f $TMPPORT > /dev/null
+	echo
+	echo
+	if [ "$DIFFOSCOPE_IN_DEBIAN" = "$DIFFOSCOPE_IN_MACPORTS" ] ; then
+		echo "Yay. diffoscope in Debian has the same version as on MacPorts: $DIFFOSCOPE_IN_DEBIAN"
+	elif dpkg --compare-versions "$DIFFOSCOPE_IN_DEBIAN" gt "$DIFFOSCOPE_IN_MACPORTS" ; then
+		echo "Fail: diffoscope in Debian:   $DIFFOSCOPE_IN_DEBIAN"
+		echo "Fail: diffoscope on MacPorts: $DIFFOSCOPE_IN_MACPORTS"
+		send_irc_warning "It seems diffoscope $DIFFOSCOPE_IN_DEBIAN is not available on MacPorts, which only has $DIFFOSCOPE_IN_MACPORTS."
+		exit 0
+	else
+		echo "diffoscope in Debian: $DIFFOSCOPE_IN_DEBIAN"
+		echo "diffoscope in MacPorts:   $DIFFOSCOPE_IN_MACPORTS"
+		echo
+		echo "Failure is the default action…"
+		exit 1
+	fi
+}
+
+
 check_whohas() {
 	# the following is "broken" (but good enough for now)
 	# as sort doesn't do proper version comparison
@@ -79,11 +104,14 @@ done
 case $1 in
 	PyPI)	check_pypi
 		;;
-	FreeBSD|NetBSD|MacPorts)
+	FreeBSD|NetBSD)
 		DISTRIBUTION=$1
 		check_whohas
 		# missing tests: Arch, Fedora, openSUSE, maybe OpenBSD, Guix…
 		;;
+	MacPorts)
+		check_github_macports
+		;;
 	*)
 		echo "Unsupported distribution."
 		exit 1



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/2af0e998976c8220578f76babd99f6a6fc9a2e35
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/20180925/2f2c365a/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list