Codebase list rust-libslirp / b6a1d24
Different release process, hopefully smoother than the previous Ximin Luo 5 years ago
3 changed file(s) with 76 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
77 git diff --quiet -- "$PKGDIR_REL" || \
88 abort 1 "Please git-add your changes to $PKGDIR_REL before running"
99
10 head -n1 "$PKGDIR/debian/changelog" | grep -q UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO || \
11 abort 1 "Package already released. If that was a mistake and you didn't actually upload yet, you may rewind your git and re-run this script."
10 RELBRANCH="pending-$PKGNAME"
11 git fetch origin --prune
12 case "$(git rev-parse --abbrev-ref HEAD)" in
13 pending-$PKGNAME) true;;
14 pending-*) abort 1 "You are on a pending-release branch for a package other than $PKGNAME, $0 can only be run on another branch, like master";;
15 *) if git rev-parse -q --verify "refs/heads/$RELBRANCH" >/dev/null || \
16 git rev-parse -q --verify "refs/remotes/origin/$RELBRANCH" >/dev/null; then
17 git checkout "$RELBRANCH"
18 else
19 git checkout -b "$RELBRANCH"
20 fi;;
21 esac
22
23 if head -n1 "$PKGDIR/debian/changelog" | grep -qv UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then
24 abort 0 "Package already released. If that was a mistake then checkout another branch, delete this one ($RELBRANCH), and re-run this script ($*)"
25 fi
1226
1327 ( cd "$PKGDIR"
1428 sed -i -e s/UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO/UNRELEASED/ debian/changelog
3044 DEBSRC=$(dpkg-parsechangelog -l build/$PKGNAME/debian/changelog -SSource)
3145 DEB_HOST_ARCH=$(dpkg-architecture -q DEB_HOST_ARCH)
3246 cat >&2 <<eof
33 Release of $CRATE ready as a source package in ${BUILDDIR#$PWD/}.
47 Release of $CRATE ready as a source package in ${BUILDDIR#$PWD/}. You need to
48 perform the following steps:
49
50 Build the package if necessary, and upload
51 ==========================================
3452
3553 If the source package is already in Debian and this version does not introduce
3654 new binaries, then you can just go ahead and directly dput the source package.
55
56 $ dput ${DEBSRC}_${DEBVER}_source.changes
3757
3858 If this is a NEW source package or introduces NEW binary packages not already
3959 in the Debian archive, you will need to build a binary package out of it. The
4868 See https://wiki.debian.org/sbuild for instructions on how to set it up. The
4969 other tools are from the 'devscripts' package.
5070
51 The above assumes you are a Debian Developer. If not, you should revert your
52 changes with \`git reset --hard @~\` and ask a Debian Developer to do this step.
71 Push this pending-release branch
72 ================================
73
74 After you have uploaded the package with dput(1), you should push $RELBRANCH so
75 that other people see it's been uploaded. Then, checkout another branch like
76 master to continue development on other packages.
77
78 $ git push origin $RELBRANCH
79 $ git checkout master
80
81 Merge the pending-release branch when ACCEPTED
82 ==============================================
83
84 When it's ACCEPTED by the Debian FTP masters, you may then merge this branch
85 back into the master branch, delete it, and push these updates to origin.
86
87 $ git checkout master
88 $ git merge $RELBRANCH
89 $ git branch -d $RELBRANCH
90 $ git push origin master :$RELBRANCH
91
92 ----
93
94 The above assumes you are a Debian Developer with upload rights. If not, you
95 should revert what I just did:
96
97 $ git checkout master
98 $ git branch -D $RELBRANCH
99
100 Then ask a Debian Developer to re-run me ($*) on your behalf.
53101 eof
00 #!/bin/sh
11
22 . ./vars.sh.frag
3
4 case "$(git rev-parse --abbrev-ref HEAD)" in
5 pending-*) abort 1 "You are on a pending-release branch, $0 can only be run on another branch, like master";;
6 esac
37
48 if [ -n "$VER" ]; then
59 if [ ! -d "$PWD/src/$PKGBASE" ]; then
00 set -e
11
22 abort() { local x=$1; shift; for i in "$@"; do echo >&2 "$0: abort: $i"; done; exit "$x"; }
3
4 HOOK_COMMIT="$(dirname "$0")/.git/hooks/pre-commit"
5 if [ ! -x "$HOOK_COMMIT" ]; then
6 cat <<'eof' >"$HOOK_COMMIT"
7 #!/bin/sh
8 if git rev-parse -q --verify MERGE_HEAD; then exit; fi
9 case $(git rev-parse --abbrev-ref HEAD) in
10 pending-*) true;;
11 *) if git diff --cached --name-only | \
12 grep '^src/.*/debian/changelog$' | \
13 while read x; do echo "$x: $(head -n1 $x)"; done | \
14 grep -v UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then
15 echo >&2 "please don't finalise changelogs directly on the master branch, use ./release.sh instead"; exit 1;
16 fi;;
17 esac
18 eof
19 chmod +x "$HOOK_COMMIT"
20 fi
321
422 if [ -n "$DEBCARGO" ]; then
523 true
1432 test -x "$DEBCARGO" || abort 1 "debcargo found but not executable: $DEBCARGO"
1533 dcver=$($DEBCARGO --version | sed -ne 's/debcargo //p')
1634 case $dcver in
17 2.0.*|2.1.0) abort 1 "unsupported debcargo version $dcver. try reinstalling with \`cargo install debcargo --force\`";;
35 2.0.*|2.1.0*) abort 1 "unsupported debcargo version $dcver. try reinstalling with \`cargo install debcargo --force\`";;
1836 2.1.*) true;;
1937 *) abort 1 "unsupported debcargo version: $dcver";;
2038 esac