]>
Commit | Line | Data |
---|---|---|
51a673e4 XL |
1 | #!/bin/bash |
2 | set -e | |
3 | ||
4 | ver="$1" | |
5 | dfsg="${2:-+dfsg1}" | |
6 | upstream_tag="upstream/${ver/\~/_}${dfsg/\~/_}" | |
7 | ||
8 | git show -s upstream/experimental | |
9 | git show -s debian/experimental | |
10 | printf "\ngit top-level dir: %s\n" "$(git rev-parse --show-toplevel)" | |
11 | printf "version: $ver\n" | |
12 | ||
13 | if ! git merge-base --is-ancestor upstream/experimental debian/experimental; then | |
14 | echo >&2 "upstream/experimental is not an ancestor of debian/experimental" | |
15 | fi | |
16 | if git rev-parse "${upstream_tag}" 2>/dev/null >/dev/null; then | |
17 | echo >&2 "tag already exists: ${upstream_tag}" | |
18 | fi | |
19 | ||
20 | read -p "continue? [y/N] " x | |
21 | if [ "$x" != "y" ]; then exit 1; fi | |
22 | ||
23 | cd "$(git rev-parse --show-toplevel)" | |
24 | git branch -f upstream/rebase-patches upstream/experimental | |
25 | git branch -f debian/rebase-patches debian/experimental | |
26 | git checkout debian/rebase-patches | |
27 | ||
28 | git branch -f patch-queue/debian/rebase-patches | |
29 | for i in debian/patches/d-00*.patch; do gbp pq apply "$i"; done | |
30 | ||
31 | gbp import-orig "../rustc_${ver}${dfsg}.orig.tar.xz" \ | |
32 | --upstream-branch=upstream/rebase-patches \ | |
33 | --debian-branch=debian/rebase-patches \ | |
34 | --no-sign-tags --no-pristine-tar --no-symlink-orig | |
35 | ||
36 | # rebase here | |
37 | echo "$0: Now manually rebase - run 'git rebase debian/rebase-patches'" | |
38 | echo "$0: There may be conflicts; follow the instructions that git tells you." | |
39 | echo "$0: When done, exit the child shell with ctrl-D" | |
40 | $SHELL | |
41 | ||
42 | gbp pq export --no-patch-numbers | |
43 | for i in debian/patches/d-00*.patch; do git add "$i"; done | |
44 | git commit -m "Update early-stage patches for ${ver}${dfsg}" | |
45 | git checkout . | |
46 | git rebase @~ --onto=debian/experimental | |
47 | git branch -f debian/experimental | |
48 | git checkout debian/experimental | |
49 | ||
50 | # cleanup | |
51 | git tag -d "${upstream_tag}" || true | |
52 | git branch -D upstream/rebase-patches || true | |
53 | git branch -D debian/rebase-patches || true | |
54 | git branch -D patch-queue/debian/rebase-patches || true |