-
Notifications
You must be signed in to change notification settings - Fork 1
/
makepub
executable file
·61 lines (44 loc) · 2.06 KB
/
makepub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
name="Ma Gnus"
if [ `whoami` != "larsi" ]; then
echo "This script is for larsi only"
exit
fi
# First do a release commit on the current version.
version=`grep "defconst gnus-version-number" lisp/gnus.el | \
sed 's/[^.0-9]//g'`
initial=`echo "$name" | sed 's/^\([A-Z]\).*/\1/g' | tr A-Z a-z`
prefix=`echo $version | sed 's/^\(.*[.]\)\([0-9][0-9]*\)/\1/'`
next_version=`echo $version | sed 's/^\(.*[.]\)\([0-9][0-9]*\)/\2/'`
next_version=`expr $next_version + 1`
next_version="$prefix$next_version"
date=`TZ=Z date "+%Y-%m-%d"`
echo -e "$date Lars Magne Ingebrigtsen <lars@ingebrigtsen.no>\n\n\t* gnus.el: $name v$next_version is released.\n"\
> /tmp/changelog
cat lisp/ChangeLog >> /tmp/changelog
mv /tmp/changelog lisp/ChangeLog
# Then update the sources to the next version.
sed "s/$name v[.0-9]*/$name v$next_version/" texi/gnus.texi > g.texi.tmp
mv g.texi.tmp texi/gnus.texi
sed "s/$name v[.0-9]*/$name v$next_version/" texi/message.texi > m.texi.tmp
mv m.texi.tmp texi/message.texi
sed "s/defconst gnus-version-number \"$version\"/defconst gnus-version-number \"$next_version\"/" lisp/gnus.el > g.el.tmp
mv g.el.tmp lisp/gnus.el
git commit -a -m "$name v$next_version is released"
tversion=`echo $next_version | sed 's/[.]/-/g'`
git tag -a "$initial$tversion" -m "$name v$next_version is released"
git push && git push origin tag "$initial$tversion"
# Increase the number, yet again, to start the next development cycle.
version=$next_version
prefix=`echo $version | sed 's/^\(.*[.]\)\([0-9][0-9]*\)/\1/'`
next_version=`echo $version | sed 's/^\(.*[.]\)\([0-9][0-9]*\)/\2/'`
next_version=`expr $next_version + 1`
next_version="$prefix$next_version"
sed "s/$name v[.0-9]*/$name v$next_version/" texi/gnus.texi > g.texi.tmp
mv g.texi.tmp texi/gnus.texi
sed "s/$name v[.0-9]*/$name v$next_version/" texi/message.texi > m.texi.tmp
mv m.texi.tmp texi/message.texi
sed "s/defconst gnus-version-number \"$version\"/defconst gnus-version-number \"$next_version\"/" lisp/gnus.el > g.el.tmp
mv g.el.tmp lisp/gnus.el
git commit -a -m "$name v$next_version is begun"
git push