From 453cc058d9ee6d7cb47529d99061216e72149a5f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 9 May 2021 06:21:55 +0200 Subject: Adding bin. Signed-off-by: Daniel Baumann --- bin/debian-sponsor.sh | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 bin/debian-sponsor.sh (limited to 'bin/debian-sponsor.sh') 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 -- cgit v1.2.3