blob: 675283c194a6f8020a838447c280ae036bd20b8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#!/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|egrep '(unstable|sid)'| 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: $DIFFOSCOPE_IN_DEBIAN"
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
else
echo "diffoscope in Debian: $DIFFOSCOPE_IN_DEBIAN"
echo "diffoscope in PyPI: $DIFFOSCOPE_IN_PYPI"
echo
echo "Failure is the default action…"
exit 1
fi
# the end
cleanup_all
trap - INT TERM EXIT
|