File: import

package info (click to toggle)
wine 10.0~repack-12
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 326,476 kB
  • sloc: ansic: 4,155,993; perl: 23,800; yacc: 22,031; javascript: 15,872; makefile: 12,346; pascal: 9,519; objc: 6,923; lex: 5,273; xml: 3,219; python: 2,688; cpp: 1,741; sh: 871; java: 750; asm: 299; cs: 62
file content (71 lines) | stat: -rwxr-xr-x 3,256 bytes parent folder | download | duplicates (3)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh -xe
# Copyright: 2013-2023 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"
tag="wine-$version"
debian="https://salsa.debian.org/wine-team/wine.git"
debian_branch="master"
upstream="https://source.winehq.org/git/wine.git"
upstream_branch="upstream"
git checkout ${upstream_branch}
git pull --verbose $debian ${upstream_branch}
git pull --verbose --no-edit $upstream tag "$tag" || echo "unable to fetch tag $tag"

# merge upstream into master (favoring "their" changes)
git checkout ${debian_branch}
git merge --strategy-option=theirs ${upstream_branch}

# 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~repack|sed "s/-/~/")-1" "New upstream release $version, released $release_date."
sed -n 's/^  - \(.*\)/- \1/p' ANNOUNCE.md | while read line; do
  dch $line
done
sed -i "s|^  \* -|    -|g" debian/changelog

# Set upstream's SERVER_PROTOCOL_VERSION in request.patch.
# Upstream stores this in their generated file include/wine/server_protocol.h, and bumps the
# version by one whenever the file is regenerated by tools/make_requests.
# So get the version on import, subtract one (since we'll do a no-change regeneration later
# which includes bumping the version again), and store it in the patch.
# Later on we remove the server_protocol.h on clean and from the orig.tar.
proto_version=$(expr $(grep "^#define SERVER_PROTOCOL_VERSION [[:digit:]]*" 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

# Set upstream's WINE_WGL_DRIVER_VERSION in opengl.patch.
# Upstream stores this in their generated file include/wine/wgl_driver.h, and bumps the
# version by one whenever the file is regenerated by dlls/opengl32/make_opengl.
# So get the version on import, subtract one (since we'll do a no-change regeneration later
# which includes bumping the version again), and store it in the patch.
# Later on we remove the wgl_driver.h on clean and from the orig.tar.
wgl_version=$(expr $(grep "^#define WINE_WGL_DRIVER_VERSION [[:digit:]]*" include/wine/wgl_driver.h | cut -d\  -f 3) - 1)
[ "$wgl_version" -lt 32767 ] || {
    echo "error: wgl_version $wgl_version is not valid."
    exit 1;}
sed -i "s|^\(+my \$wgl_version = \)[[:digit:]]*;|\1${wgl_version};|" debian/patches/generate/opengl.patch

git add debian/changelog debian/patches/generate/request.patch debian/patches/generate/opengl.patch
git commit -m "Finalize automatic import of wine-$1."