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 42 43 44 45 46 47 48
|
#!/bin/bash -e
# Repack an upstream tarball, unpacking waf files inside it.
#
# Meant to be run by uscan(1) as the "command param", after repacking
# (if any) by mk-origtargz. So you shouldn't give "repacksuffix" to
# debian/watch; instead you should set it below; however this should
# still match the dversionmangle in that file.
unwaf_paths=.
# You shouldn't need to change anything below here.
USAGE="Usage: $0 --upstream-version version filename"
test "$1" = "--upstream-version" || { echo >&2 "$USAGE"; exit 2; }
upstream="$2"
filename="$3"
source="$(dpkg-parsechangelog -SSource)"
basedir="$(dirname "$filename")"
unpack_waf() {
local olddir="$PWD"
cd "$1"
test -x ./waf || return 1
./waf --help > /dev/null
mv .waf3-*/* .
sed -i '/^#==>$/,$d' waf
rmdir .waf3-*
find waf* -name "*.pyc" -delete
cd "$olddir"
}
mkdir tmp
pushd tmp
tar -xf "../../${source}_${upstream}.orig.tar.xz"
SUBDIR=`ls`
echo $SUBDIR
cd ${SUBDIR}
for i in $unwaf_paths; do unpack_waf "$i"; done
cd ..
rm -f ../../${source}_${upstream}.orig.tar.gz
tar -czf "../../${source}_${upstream}.orig.tar.gz" ${SUBDIR}
rm -rf ${SUBDIR}
popd
rm -rf tmp
|