wlroots-hyprland/contrib/_incr_version

29 lines
602 B
Text
Raw Normal View History

2019-08-27 05:28:37 +02:00
#!/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' ]
2019-08-27 05:28:37 +02:00
then
printf "Bugfix release (no backwards-incompatible ABI changes)? (y/n) "
read bugfix
2019-08-27 05:28:37 +02:00
fi
soversion=$(egrep '^soversion =' meson.build | cut -d'=' -f2-)
soversion=$((soversion))
2019-08-27 05:28:37 +02:00
if [ "$bugfix" != 'y' ]
2019-08-27 05:28:37 +02:00
then
soversion=$((soversion+1))
2019-08-27 05:28:37 +02:00
fi
sed -i meson.build \
-e "s/soversion = .*/soversion = $soversion/g"
2019-08-27 05:28:37 +02:00
exit 1
2019-08-27 05:28:37 +02:00
git add meson.build
git commit -m "Update version to $new_version"