aboutsummaryrefslogtreecommitdiff
path: root/contrib/_incr_version
blob: 949c845bbb7aa5acf7f8f212d55b7cb087dbab30 (plain)
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
#!/bin/sh -eu
old_version="$1"
new_version="$2"
sed -i meson.build -e "s/version: '$old_version'/version: '$new_version'/g"

bugfix='n'
printf "Breaking API changes? (y/n) "
read breaking
if [ "$breaking" = 'n' ]
then
	printf "Bugfix release (no backwards-incompatible ABI changes)? (y/n) "
	read bugfix
fi

soversion=$(egrep '^soversion =' meson.build | cut -d'=' -f2-)
soversion=$((soversion))

if [ "$bugfix" != 'y' ]
then
	soversion=$((soversion+1))
fi

sed -i meson.build \
	-e "s/soversion = .*/soversion = $soversion/g"

exit 1
git add meson.build
git commit -m "Update version to $new_version"