Improve the release make targets
[nobug] / admin / update_version.sh
1 #!/bin/bash
2
3 last=$(<VERSION)
4
5 last_major=${last%.*}
6 last_minor=${last#*.}
7
8 current_major=$(date +%Y%m)
9 current_minor=1
10
11 if [[ $current_major = $last_major ]]; then
12     (( current_minor+=$last_minor ))
13 fi
14
15 current=$current_major.$current_minor
16
17 echo $current >VERSION
18
19 ed configure.ac <<EOF
20 /AC_INIT/c
21 AC_INIT([nobug], [$current])
22 .
23 w
24 q
25 EOF
26
27 git add VERSION configure.ac
28