From 064566085e866af4a51d12cc9fdbb52e28408eef Mon Sep 17 00:00:00 2001 From: filux Date: Thu, 4 Feb 2016 19:29:12 +0100 Subject: [PATCH] get rid of '$Rev$' --- mk/linux/mg-version-synch.sh | 8 ++++---- source/glest_game/facilities/game_util.cpp | 22 ++++++++++------------ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/mk/linux/mg-version-synch.sh b/mk/linux/mg-version-synch.sh index f9c2a629..8b409b28 100755 --- a/mk/linux/mg-version-synch.sh +++ b/mk/linux/mg-version-synch.sh @@ -33,16 +33,16 @@ if [ "$modifymore" = "yes" ]; then echo fi if [ "$modifymore" = "yes" ] && [ "$(git status >/dev/null 2>&1; echo "$?")" -eq "0" ]; then - # const string GIT_RawRev = "$4446.1a8673f$"; + # const string GIT_RawRev = "$4446.1a8673f$"; GitCommitForRelease="`git rev-list HEAD --count`.`git log -1 --format=%h`"; echo 'GitCommitForRelease # before:' grep -E '^GitCommitForRelease = "[^"]*";$' "$VERSION_INFO_FILE" - grep -E '^const string GIT_RawRev = "\$[^"$]*\$";$' ../../source/glest_game/facilities/game_util.cpp + grep -E '^ const string GIT_RawRev = "\$[^"$]*\$";$' ../../source/glest_game/facilities/game_util.cpp sed -i 's/^GitCommitForRelease = "[^"]*";$/GitCommitForRelease = "'$GitCommitForRelease'";/' "$VERSION_INFO_FILE" - sed -i 's/^const string GIT_RawRev = "$[^"]*";$/const string GIT_RawRev = "$'$GitCommitForRelease'$";/' ../../source/glest_game/facilities/game_util.cpp + sed -i 's/^ const string GIT_RawRev = "$[^"]*";$/ const string GIT_RawRev = "$'$GitCommitForRelease'$";/' ../../source/glest_game/facilities/game_util.cpp echo 'GitCommitForRelease # after:' grep -E '^GitCommitForRelease = "[^"]*";$' "$VERSION_INFO_FILE" - grep -E '^const string GIT_RawRev = "\$[^"$]*\$";$' ../../source/glest_game/facilities/game_util.cpp + grep -E '^ const string GIT_RawRev = "\$[^"$]*\$";$' ../../source/glest_game/facilities/game_util.cpp fi echo if [ "$modifymore" = "yes" ]; then diff --git a/source/glest_game/facilities/game_util.cpp b/source/glest_game/facilities/game_util.cpp index e5379376..e3a422db 100644 --- a/source/glest_game/facilities/game_util.cpp +++ b/source/glest_game/facilities/game_util.cpp @@ -30,22 +30,20 @@ namespace Glest { namespace Game { const char *mailString = " http://bugs.megaglest.org"; // !! Use minor versions !! Only major and minor version control compatibility! -// typical version numbers look like this: v3.11-beta1.0 v3.12-dev v3.12.0 -// don't forget to update source/version.txt +// typical version numbers look like this: v3.13-beta1.0 v3.12-dev v3.12.1 +// don't forget to update file: source/version.txt const string glestVersionString = "v3.12-dev"; const string lastCompatibleSaveGameVersionString = "v3.11.1"; -#if defined(GITVERSION) - const string GIT_RawRev = string(GITVERSION); - const string GIT_Rev = string("Rev: ") + string(GITVERSION); -#elif defined(GITVERSIONHEADER) -#include "gitversion.h" - const string GIT_RawRev = string(GITVERSION); - const string GIT_Rev = string("Rev: ") + string(GITVERSION); -#else -const string GIT_RawRev = "$5421.18cad36$"; -const string GIT_Rev = "$Rev$"; +#if defined(GITVERSIONHEADER) + #include "gitversion.h" #endif +#if defined(GITVERSION) || defined(GITVERSIONHEADER) + const string GIT_RawRev = string(GITVERSION); +#else + const string GIT_RawRev = "$5421.18cad36$"; +#endif +const string GIT_Rev = string("Rev: ") + string(GIT_RawRev); string getRAWGITRevisionString() { return GIT_RawRev;