summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2016-03-09 15:29:13 +0100
committerHolger Levsen <holger@layer-acht.org>2016-03-09 15:29:13 +0100
commit16aaa1e262784593f392bf881f11eaea3582c677 (patch)
tree0a15b63296fadb355b273aa1fc75e676c476fe9e /bin
parentb2f13291017098b6a77738240fe6a8151a141d98 (diff)
downloadjenkins.debian.net-16aaa1e262784593f392bf881f11eaea3582c677.tar.xz
reproducible diffoscope: add a new job to test whether diffoscope on PyPI is as new as in Debian
Diffstat (limited to 'bin')
-rwxr-xr-xbin/diffoscope_pypi_test.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/bin/diffoscope_pypi_test.sh b/bin/diffoscope_pypi_test.sh
new file mode 100755
index 00000000..88dd8506
--- /dev/null
+++ b/bin/diffoscope_pypi_test.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# Copyright 2014-2016 Holger Levsen <holger@layer-acht.org>
+# released under the GPLv=2
+
+DEBUG=false
+#. /srv/jenkins/bin/common-functions.sh
+#common_init "$@"
+
+cleanup_all() {
+ rm $TMPPYPI
+}
+
+
+#
+# main
+#
+TMPPYPI=$(mktemp -t diffoscope-pypi-XXXXXXXX)
+trap cleanup_all INT TERM EXIT
+
+DIFFOSCOPE_IN_DEBIAN=$(rmadison diffoscope|grep unstable| cut -d "|" -f2 || true)
+curl https://pypi.python.org/pypi/diffoscope/ -o $TMPPYPI
+DIFFOSCOPE_IN_PYPI=$(grep "<title>" $TMPPYPI | cut -d ">" -f2- | cut -d ":" -f1 |cut -d " " -f2)
+echo
+echo
+
+if [ "$DIFFOSCOPE_IN_DEBIAN" = "$DIFFOSCOPE_IN_PYPI" ] ; then
+ echo "Yay. diffoscope in Debian has the same version as on PyPI."
+elif dpkg --compare-versions "$DIFFOSCOPE_IN_DEBIAN" gt "$DIFFOSCOPE_IN_PYPI" ; then
+ echo "Fail: diffoscope in Debian: $DIFFOSCOPE_IN_DEBIAN"
+ echo "Fail: diffoscope in PyPI: $DIFFOSCOPE_IN_PYPI"
+ exit 1
+fi
+
+# the end
+cleanup_all
+trap - INT TERM EXIT