]> git.proxmox.com Git - debcargo-conf.git/blob - release.sh
Update docs
[debcargo-conf.git] / release.sh
1 #!/bin/sh
2
3 . ./vars.sh.frag
4
5 git diff --quiet --cached || \
6 abort 1 "You have other pending changes to git, please complete it or stash it away and re-run this script."
7
8 git diff --quiet -- "$PKGDIR_REL" || \
9 abort 1 "Please git-add your changes to $PKGDIR_REL before running"
10
11 head -n1 "$PKGDIR/debian/changelog" | grep -q UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO || \
12 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."
13
14 ( cd "$PKGDIR"
15 sed -i -e s/UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO/UNRELEASED/ debian/changelog
16 dch -r -D unstable ""
17 git add debian/changelog
18 )
19
20 rm -rf "$BUILDDIR" "$(dirname "$BUILDDIR")/rust-$PKG-$VER_$VER"*.orig.tar.*
21 $DEBCARGO package --config "$PKGCFG" --directory "$BUILDDIR" --changelog-ready "$PKG" "$VER"
22
23 git diff --exit-code -- "$PKGDIR_REL" || \
24 abort 1 "Release attempt resulted in git diffs to $PKGDIR_REL. Check it, git add or reset as appropriate, and re-run this again."
25
26 git commit -m "Release package $PKG"
27
28 ( cd "$BUILDDIR" && dpkg-buildpackage -d -S --no-sign )
29
30 cat >&2 <<eof
31 Release of $PKG ready as a source package in ${BUILDDIR#$PWD/}.
32
33 If the source package is already in Debian and this version does not introduce
34 new binaries, then you can just go ahead and directly dput the source package.
35
36 If this is a NEW source package or introduces NEW binary packages not already
37 in the Debian archive, you will need to build a binary package out of it. The
38 recommended way is to run something like:
39
40 $ sbuild <source_package.dsc>
41 $ changestool <sbuild_binary_changes.changes> addsc <source_package.dsc>
42 $ debsign --no-re-sign <sbuild_binary_changes.changes>
43 $ dput <sbuild_binary_changes.changes>
44
45 See https://wiki.debian.org/sbuild for instructions on how to set it up. The
46 other tools are from the 'devscripts' package.
47
48 The above assumes you are a Debian Developer. If not, you should revert your
49 changes and ask a Debian Developer to do this step.
50 eof