summaryrefslogtreecommitdiffstats
path: root/prepare-release.sh
diff options
context:
space:
mode:
Diffstat (limited to 'prepare-release.sh')
-rwxr-xr-xprepare-release.sh80
1 files changed, 80 insertions, 0 deletions
diff --git a/prepare-release.sh b/prepare-release.sh
new file mode 100755
index 0000000..db736b7
--- /dev/null
+++ b/prepare-release.sh
@@ -0,0 +1,80 @@
1#!/bin/bash
2
3# Script to run to prepare a new release.
4# It will update the release number and tell you to update the
5# CHANGES file and to double check everything looks before doing
6# the release commit and tagging.
7
8# Afterwards you probably want to run release-update.sh to upload
9# the release and update the website at https://sourceware.org/bzip2/
10
11# Any error is fatal
12set -e
13
14# We take one argument, the version (e.g. 1.0.7)
15if [ $# -ne 1 ]; then
16 echo "$0 <version> (e.g. 1.0.7)"
17 exit 1
18fi
19
20LANG=C
21VERSION="$1"
22DATE=$(date +"%d %B %Y")
23
24# Replace the version strings in the comments
25VER_PREFIX="bzip2/libbzip2 version "
26sed -i -e "s@${VER_PREFIX}[0-9].*@${VER_PREFIX}${VERSION} of ${DATE}@" \
27 CHANGES LICENSE README* *.c *.h *.pl *.sh
28
29# Add an entry to the README
30DAY=$(date +"%d")
31MONTH=$(date +"%B")
32SHORTMONTH=$(date +"%b")
33YEAR=$(date +"%Y")
34printf "%2s %8s %s\n" "$DAY" "$MONTH" "$YEAR (bzip2, version $VERSION)" \
35 >> README
36
37# Update manual
38sed -i -e "s@ENTITY bz-version \".*\"@ENTITY bz-version \"$VERSION\"@" \
39 -e "s@ENTITY bz-date \".*\"@ENTITY bz-date \"$DAY $MONTH $YEAR\"@" \
40 entities.xml
41
42# bzip2.1 should really be generated from the manual.xml, but currently
43# isn't, so explicitly change it here too.
44sed -i -e "s@This manual page pertains to version .* of@This manual page pertains to version $VERSION of@" \
45 -e "s@sorting file compressor, v.*@sorting file compressor, v$VERSION@" \
46 bzip2.1* bzip2.txt
47
48# Update sources. All sources, use bzlib_private.
49# Except bzip2recover, which embeds a version string...
50sed -i -e "s@^#define BZ_VERSION \".*\"@#define BZ_VERSION \"${VERSION}, ${DAY}-${SHORTMONTH}-${YEAR}\"@" \
51 bzlib_private.h
52sed -i -e "s@\"bzip2recover .*: extracts blocks from damaged@\"bzip2recover ${VERSION}: extracts blocks from damaged@" \
53 bzip2recover.c
54
55# And finally update the version/dist/so_name in the Makefiles.
56sed -i -e "s@^DISTNAME=bzip2-.*@DISTNAME=bzip2-${VERSION}@" \
57 Makefile
58sed -i -e "s@libbz2\.so\.[0-9]\.[0-9]\.[0-9]*@libbz2\.so\.${VERSION}@" \
59 Makefile-libbz2_so
60
61echo "Now make sure the diff looks correct:"
62echo " git diff"
63echo
64echo "And make sure there is a $VERSION section in the CHANGES file."
65echo
66echo "Double check:"
67echo " make clean && make dist && make clean && make -f Makefile-libbz2_so"
68echo
69echo "Does everything look fine?"
70echo
71echo "git commit -a -m \"Prepare for $VERSION release.\""
72echo "git push"
73echo
74echo "Wait for the buildbot to give the all green!"
75echo "Then..."
76echo
77echo "git tag -s -m \"bzip2 $VERSION release\" bzip2-$VERSION"
78echo "git push --tags"
79echo
80echo "./release-update.sh"