wpa/debian/uscan-hook

29 lines
827 B
Bash
Executable File

#!/bin/sh
set -e
# TODO: this script needs to be updated to work with watch file version 4
# This script is invoked by uscan after downloading a new tarball
if [ "$1" != "--upstream-version" ] || [ $# != 3 ]; then
echo "invalid arguments: $*" >&2
exit 2
fi
version="$2"
filename="$3"
rm -f "$filename" "../hostapd-${2}.tar.gz"
merged_tarball="$(./debian/get-orig-source $(pwd) ${version} | awk '/^SUCCESS: New upstream tarball has been saved at/{print $9}')"
if [ -n "${merged_tarball}" ] && [ -w "${merged_tarball}" ]; then
# write to ../tarballs/, if it exists - ../ otherwise
if [ ! -e "../wpa_${version}.orig.tar.xz" ]; then
ln -fs "${merged_tarball}" "../"
fi
echo "svn-upgrade ../$(basename ${merged_tarball}) -V ${version}" >&2
exit 0
else
echo "failed to generate merged upstream tarball" >&2
exit 3
fi