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