downgrade tar to v1.29 if v1.30 is installed

tar v1.30 breaks pristine-tar's ability to work with commits created
by older versions of tar
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901952
This commit is contained in:
Hans-Christoph Steiner 2018-09-26 10:44:09 +02:00
parent a4e6fc9bd8
commit 3ace0c6e64
1 changed files with 13 additions and 2 deletions

View File

@ -31,11 +31,22 @@ if [[ $debversion = *-* ]]; then
git clean -fdx git clean -fdx
git reset --hard git reset --hard
git fetch --all git fetch --all
git checkout -B pristine-tar origin/pristine-tar || ( \ if git checkout -B pristine-tar origin/pristine-tar; then
tar_version=`dpkg -s tar | grep '^Version:'`
if [[ $tar_version == "Version: 1.30"* ]]; then
echo "WARNING: tar v1.30 breaks pristine-tar when working with commits created by older versions of tar https://bugs.debian.org/901952, downgrading to tar 1.29b-1.1"
printf 'Package: tar\nPin: version 1.30+dfsg-2\nPin-Priority: -1\n' \
> /etc/apt/preferences.d/ban-broken-tar.pref
$apt_get install --no-install-recommends wget
wget -q http://deb.debian.org/debian/pool/main/t/tar/tar_1.29b-1.1_amd64.deb
dpkg -i tar_1.29b-1.1_amd64.deb
rm -f tar_1.29b-1.1_amd64.deb
fi
else
echo "no pristine-tar branch, trying uscan"; echo "no pristine-tar branch, trying uscan";
apt_get_auto_install gnupg2 libwww-perl; apt_get_auto_install gnupg2 libwww-perl;
uscan --verbose --download-current-version --force-download --rename --skip-signature; uscan --verbose --download-current-version --force-download --rename --skip-signature;
) fi
else else
echo "building native package version $debversion" echo "building native package version $debversion"
fi fi