diff options
author | ShadowNinja <shadowninja@minetest.net> | 2015-05-04 18:46:49 -0400 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-05-05 17:13:05 +0200 |
commit | 1be2d32fd502eeb68bd63fb07b0325b25ee357bd (patch) | |
tree | c1c1481f91d0d933a65459354cf979d461557223 /util | |
parent | dfd790930c8c1464ead730999c3ac9677d130360 (diff) | |
download | minetest-1be2d32fd502eeb68bd63fb07b0325b25ee357bd.tar.gz minetest-1be2d32fd502eeb68bd63fb07b0325b25ee357bd.tar.bz2 minetest-1be2d32fd502eeb68bd63fb07b0325b25ee357bd.zip |
Make Git version detection use VERSION_STRING instead of tags
This fixes the problem where 0.4.12-dev versions were erroneously shown as
0.4.11-dev because the tag was added on a separate branch. It also fixes a
similar issue when builders didn't fetch new tags when updating.
This also removes the number-of-commits-since-tag field, since it's
incompatible with this. Said field doesn't seem to be useful anyway if you
have the commit hash.
Diffstat (limited to 'util')
-rwxr-xr-x | util/bump_version.sh | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/util/bump_version.sh b/util/bump_version.sh index b45c63664..5ff69c8af 100755 --- a/util/bump_version.sh +++ b/util/bump_version.sh @@ -87,7 +87,7 @@ sed -i -re "s/^set\(VERSION_MINOR [0-9]+\)$/set(VERSION_MINOR $NEW_VERSION_MINOR sed -i -re "s/^set\(VERSION_PATCH [0-9]+\)$/set(VERSION_PATCH $NEW_VERSION_PATCH)/" CMakeLists.txt || die "Failed to update VERSION_PATCH" -sed -i -re "s/^\tset\(VERSION_PATCH \\\$.VERSION_PATCH}-dev\)$/\t#set(VERSION_PATCH \${VERSION_PATCH}-dev)/" CMakeLists.txt || die "Failed to disable -dev suffix" +sed -i -re "s/^set\(DEVELOPMENT_BUILD TRUE\)$/set(DEVELOPMENT_BUILD FALSE)/" CMakeLists.txt || die "Failed to unset DEVELOPMENT_BUILD" sed -i -re "s/^ANDROID_VERSION_CODE = [0-9]+$/ANDROID_VERSION_CODE = $NEW_ANDROID_VERSION_CODE/" build/android/Makefile || die "Failed to update ANDROID_VERSION_CODE" @@ -98,3 +98,24 @@ sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" doc/menu_lua_api.txt || di git add -f CMakeLists.txt build/android/Makefile doc/lua_api.txt doc/menu_lua_api.txt || die "git add failed" git commit -m "Bump version to $NEW_VERSION" || die "git commit failed" + +############ +# Create tag +############ + +echo "Tagging $NEW_VERSION" + +git tag -a "$NEW_VERSION" -m "$NEW_VERSION" || die 'Adding tag failed' + +###################### +# Create revert commit +###################### + +echo 'Creating "revert to development" commit' + +sed -i -re 's/^set\(DEVELOPMENT_BUILD FALSE\)$/set(DEVELOPMENT_BUILD TRUE)/' CMakeLists.txt || die 'Failed to set DEVELOPMENT_BUILD' + +git add -f CMakeLists.txt || die 'git add failed' + +git commit -m "Continue with $NEW_VERSION-dev" || die 'git commit failed' + |