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 49 50
|
#!/bin/sh -e
# Copyright: 2013-2015 Michael Gilbert <mgilbert@debian.org>
# License: LGPL-2.1
# check for version argument
if [ "$#" -lt "1" ]; then
echo "usage: $(basename $0) <upstream version number>"
exit 1
fi
# terminate if we're not building from a git tree
if [ ! -d ".git" ]; then
echo "error: importing only supported for git checkouts"
exit 1
fi
# ignore changes to files that will be automatically generated
git update-index --assume-unchanged configure include/config.h.in
# pull specified tag from upstream repository
version="$1"
debian="https://anonscm.debian.org/git/pkg-wine/wine.git"
upstream_branch="upstream"
winehq="git://source.winehq.org/git/wine.git"
tag="wine-$version"
git checkout ${upstream_branch}
git pull $debian ${upstream_branch}
git pull --no-edit $winehq tag "$tag" || echo "unable to fetch tag $tag"
# merge upstream into master (favoring "their" changes)
git checkout master
git merge --strategy-option=theirs upstream
# format the "New upstream release" message
tag_time=`git cat-file tag "$tag" | sed -n 's/tagger .*<.*> \([0-9]*\) .*/\1/p'`
release_date=`LC_ALL=C date -u -d "@$tag_time" +"%b %-d, %Y"`
# create the initial changelog entry
dch -v "$(echo $version|sed "s/-/~/")-1" "New upstream release $version, released $release_date."
sed -n 's/^ - \(.*\)/- \1/p' ANNOUNCE | while read line; do
dch $line
done
# set upstream's SERVER_PROTOCOL_VERSION in request.patch
# this is usually stored in include/wine/server_protocol.h, but we clean that file because it is generated
proto_version=$(expr $(grep "#define SERVER_PROTOCOL_VERSION" include/wine/server_protocol.h | cut -d\ -f 3) - 1)
[ "$proto_version" -lt 32767 ] || {
echo "error: proto_version $proto_version is not valid."
exit 1;}
sed -i "s|\(+ my \$protocol = \)[[:digit:]]*;|\1${proto_version};|" debian/patches/generate/request.patch
|