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
|
#!/bin/sh
# Repack tarball because of ._ files
set -e
# Remark: A new uscan that enables easier handling of removing files can be
# obtained via
# git clone git://tille@git.debian.org/git/users/tille/devscripts.git
# and then copy scripts/uscan.pl as uscan at the beginning of your PATH
if uscan --help | grep -q -- --repack-compression ; then
echo "Use new enhanced uscan"
uscan --verbose --force-download --repack-compression xz
exit
fi
NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
UNAME=`echo $NAME | sed 's/^python-//'`
if ! echo $@ | grep -q upstream-version ; then
VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-.\+$/\1/'`
uscan --force-download
else
VERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*${NAME}.*?\1?"`
if echo "$VERSION" | grep -q "upstream-version" ; then
echo "Unable to parse version number"
exit
fi
fi
TARDIR=${UNAME}-${VERSION}
mkdir -p ../tarballs
cd ../tarballs
tar -xaf ../${TARDIR}.tgz
find . -name "._*" -type f -delete
GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.gz "${TARDIR}"
rm -rf "${TARDIR}"
|