summaryrefslogtreecommitdiffstats
path: root/bin/debian-sponsor.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-05-09 04:21:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-05-09 04:21:55 +0000
commit453cc058d9ee6d7cb47529d99061216e72149a5f (patch)
tree38e3683d9cb52c2f181d65ba513554a5e1387f20 /bin/debian-sponsor.sh
parentInitial commit. (diff)
downloadprogress-linux-tools-453cc058d9ee6d7cb47529d99061216e72149a5f.tar.xz
progress-linux-tools-453cc058d9ee6d7cb47529d99061216e72149a5f.zip
Adding bin.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/debian-sponsor.sh')
-rwxr-xr-xbin/debian-sponsor.sh68
1 files changed, 68 insertions, 0 deletions
diff --git a/bin/debian-sponsor.sh b/bin/debian-sponsor.sh
new file mode 100755
index 0000000..17191f5
--- /dev/null
+++ b/bin/debian-sponsor.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+set -e
+
+DSC="${1}"
+
+case "${DSC}" in
+ *.dsc)
+ ;;
+
+ *)
+ echo "Usage: ${0} DSC"
+ ;;
+esac
+
+SOURCE="$(basename ${DSC} | awk -F_ '{ print $1 }')"
+
+# Download sources
+mkdir -p NEW OLD
+
+cd NEW
+DGET_VERIFY=no dget --insecure -u -d "${DSC}"
+cd "${OLDPWD}"
+
+cd OLD
+apt source --only-source --download-only ${SOURCE}
+cd "${OLDPWD}"
+
+# Compare upstream tarballs
+if [ -e NEW/$(basename OLD/*.orig.tar.*) ]
+then
+ OLD_MD5="$(md5sum OLD/*.orig.tar.* | awk '{ print $1 }')"
+ NEW_MD5="$(md5sum OLD/*.orig.tar.* | awk '{ print $1 }')"
+
+ if [ "${OLD_MD5}" != "${NEW_MD5}" ]
+ then
+ echo "E: upstream tarballs do not match!"
+ echo "E: new version?"
+ fi
+fi
+
+# Unpack upstream
+cd NEW
+dpkg-source -x --skip-debianization *.dsc ${SOURCE}
+cd "${OLDPWD}"
+
+cd OLD
+dpkg-source -x --skip-debianization *.dsc ${SOURCE}
+cd "${OLDPWD}"
+
+# Compare upstream
+set +e
+diff -Naurp OLD/${SOURCE} NEW/${SOURCE} > upstream.diff
+set -e
+
+# Unpack debian
+cd "NEW/${SOURCE}"
+tar xf ../*debian.tar.*
+cd "${OLDPWD}"
+
+cd "OLD/${SOURCE}"
+tar xf ../*debian.tar.*
+cd "${OLDPWD}"
+
+# Compare debian
+set +e
+diff -Naurp OLD/${SOURCE}/debian NEW/${SOURCE}/debian > debian.diff
+set -e