2019-08-27 03:28:37 +00:00
|
|
|
#!/bin/sh -eu
|
|
|
|
old_version="$1"
|
|
|
|
new_version="$2"
|
|
|
|
sed -i meson.build -e "s/version: '$old_version'/version: '$new_version'/g"
|
|
|
|
|
2020-01-22 20:03:30 +00:00
|
|
|
bugfix='n'
|
|
|
|
printf "Breaking API changes? (y/n) "
|
|
|
|
read breaking
|
|
|
|
if [ "$breaking" = 'n' ]
|
2019-08-27 03:28:37 +00:00
|
|
|
then
|
2020-01-22 20:03:30 +00:00
|
|
|
printf "Bugfix release (no backwards-incompatible ABI changes)? (y/n) "
|
|
|
|
read bugfix
|
2019-08-27 03:28:37 +00:00
|
|
|
fi
|
|
|
|
|
2020-01-22 20:03:30 +00:00
|
|
|
soversion=$(egrep '^soversion =' meson.build | cut -d'=' -f2-)
|
|
|
|
soversion=$((soversion))
|
2019-08-27 03:28:37 +00:00
|
|
|
|
2020-01-22 20:03:30 +00:00
|
|
|
if [ "$bugfix" != 'y' ]
|
2019-08-27 03:28:37 +00:00
|
|
|
then
|
2020-01-22 20:03:30 +00:00
|
|
|
soversion=$((soversion+1))
|
2019-08-27 03:28:37 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
sed -i meson.build \
|
2020-01-22 20:03:30 +00:00
|
|
|
-e "s/soversion = .*/soversion = $soversion/g"
|
2019-08-27 03:28:37 +00:00
|
|
|
|
2020-01-22 20:03:30 +00:00
|
|
|
exit 1
|
2019-08-27 03:28:37 +00:00
|
|
|
git add meson.build
|
|
|
|
git commit -m "Update version to $new_version"
|