diff options
Diffstat (limited to '')
-rwxr-xr-x | prepare-release.sh | 80 |
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 | ||
12 | set -e | ||
13 | |||
14 | # We take one argument, the version (e.g. 1.0.7) | ||
15 | if [ $# -ne 1 ]; then | ||
16 | echo "$0 <version> (e.g. 1.0.7)" | ||
17 | exit 1 | ||
18 | fi | ||
19 | |||
20 | LANG=C | ||
21 | VERSION="$1" | ||
22 | DATE=$(date +"%d %B %Y") | ||
23 | |||
24 | # Replace the version strings in the comments | ||
25 | VER_PREFIX="bzip2/libbzip2 version " | ||
26 | sed -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 | ||
30 | DAY=$(date +"%d") | ||
31 | MONTH=$(date +"%B") | ||
32 | SHORTMONTH=$(date +"%b") | ||
33 | YEAR=$(date +"%Y") | ||
34 | printf "%2s %8s %s\n" "$DAY" "$MONTH" "$YEAR (bzip2, version $VERSION)" \ | ||
35 | >> README | ||
36 | |||
37 | # Update manual | ||
38 | sed -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. | ||
44 | sed -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... | ||
50 | sed -i -e "s@^#define BZ_VERSION \".*\"@#define BZ_VERSION \"${VERSION}, ${DAY}-${SHORTMONTH}-${YEAR}\"@" \ | ||
51 | bzlib_private.h | ||
52 | sed -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. | ||
56 | sed -i -e "s@^DISTNAME=bzip2-.*@DISTNAME=bzip2-${VERSION}@" \ | ||
57 | Makefile | ||
58 | sed -i -e "s@libbz2\.so\.[0-9]\.[0-9]\.[0-9]*@libbz2\.so\.${VERSION}@" \ | ||
59 | Makefile-libbz2_so | ||
60 | |||
61 | echo "Now make sure the diff looks correct:" | ||
62 | echo " git diff" | ||
63 | echo | ||
64 | echo "And make sure there is a $VERSION section in the CHANGES file." | ||
65 | echo | ||
66 | echo "Double check:" | ||
67 | echo " make clean && make dist && make clean && make -f Makefile-libbz2_so" | ||
68 | echo | ||
69 | echo "Does everything look fine?" | ||
70 | echo | ||
71 | echo "git commit -a -m \"Prepare for $VERSION release.\"" | ||
72 | echo "git push" | ||
73 | echo | ||
74 | echo "Wait for the buildbot to give the all green!" | ||
75 | echo "Then..." | ||
76 | echo | ||
77 | echo "git tag -s -m \"bzip2 $VERSION release\" bzip2-$VERSION" | ||
78 | echo "git push --tags" | ||
79 | echo | ||
80 | echo "./release-update.sh" | ||