From 3c7a08afc2b41b9814ce182324947ed2f5155118 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 25 May 2014 03:18:05 -0700 Subject: [PATCH] Change version display. --- core/sm_srvcmds.cpp | 3 ++- public/sourcemod_version.h | 4 ++-- tools/buildbot/generate_headers.py | 4 +++- versionlib/versionlib.cpp | 3 ++- versionlib/versionlib.h | 6 ++++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/core/sm_srvcmds.cpp b/core/sm_srvcmds.cpp index 766ceb907..de81d10a3 100644 --- a/core/sm_srvcmds.cpp +++ b/core/sm_srvcmds.cpp @@ -340,7 +340,8 @@ void RootConsoleMenu::OnRootConsoleCommand(const char *cmdname, const CCommand & ConsolePrint(" SourcePawn Engine: %s (build %s NO JIT)", g_pSourcePawn2->GetEngineName(), g_pSourcePawn2->GetVersionString()); ConsolePrint(" SourcePawn API: v1 = %d, v2 = %d", g_pSourcePawn->GetEngineAPIVersion(), g_pSourcePawn2->GetAPIVersion()); ConsolePrint(" Compiled on: %s %s", __DATE__, __TIME__); - ConsolePrint(" Build ID: %s", SOURCEMOD_BUILD_ID); + ConsolePrint(" Built from: https://github.com/alliedmodders/sourcemod/commit/%s", SOURCEMOD_SHA); + ConsolePrint(" Build ID: %d:%s", SOURCEMOD_LOCAL_REV, SOURCEMOD_SHA); ConsolePrint(" http://www.sourcemod.net/"); } } diff --git a/public/sourcemod_version.h b/public/sourcemod_version.h index c9ef3b0d8..095b993b7 100644 --- a/public/sourcemod_version.h +++ b/public/sourcemod_version.h @@ -49,13 +49,13 @@ # endif #else #define SM_BUILD_TAG "manual" -#define SM_BUILD_REV "0" +#define SM_BUILD_LOCAL_REV "0" #define SM_BUILD_CSET "0" #define SM_BUILD_MAJOR "1" #define SM_BUILD_MINOR "6" #define SM_BUILD_RELEASE "0" -#define SM_BUILD_UNIQUEID SM_BUILD_REV ":" SM_BUILD_CSET +#define SM_BUILD_UNIQUEID SM_BUILD_LOCAL_REV ":" SM_BUILD_CSET #define SM_VERSION_STRING SM_BUILD_MAJOR "." SM_BUILD_MINOR "." SM_BUILD_RELEASE "-" SM_BUILD_TAG #define SM_VERSION_FILE 1,6,0,0 diff --git a/tools/buildbot/generate_headers.py b/tools/buildbot/generate_headers.py index 068802714..d0ba166d0 100644 --- a/tools/buildbot/generate_headers.py +++ b/tools/buildbot/generate_headers.py @@ -72,6 +72,7 @@ def output_version_headers(): #define SM_BUILD_MAJOR \"{2}\" #define SM_BUILD_MINOR \"{3}\" #define SM_BUILD_RELEASE \"{4}\" +#define SM_BUILD_LOCAL_REV \"{9}\" #define SM_BUILD_UNIQUEID "{9}:" SM_BUILD_CSET @@ -93,8 +94,9 @@ def output_version_headers(): #define SOURCEMOD_V_MAJOR {2} #define SOURCEMOD_V_MINOR {3} #define SOURCEMOD_V_RELEASE {4} +#define SOURCEMOD_V_REV {6} #define SOURCEMOD_VERSION \"{5}\" - """.format(tag, shorthash, major, minor, release, fullstring)) + """.format(tag, shorthash, major, minor, release, fullstring, count)) output_version_headers() diff --git a/versionlib/versionlib.cpp b/versionlib/versionlib.cpp index 571d33b5e..d4ee52305 100644 --- a/versionlib/versionlib.cpp +++ b/versionlib/versionlib.cpp @@ -29,6 +29,7 @@ #include #include -const char *SOURCEMOD_BUILD_ID = SM_BUILD_UNIQUEID; +const char *SOURCEMOD_LOCAL_REV = SM_BUILD_LOCAL_REV; +const char *SOURCEMOD_SHA = SM_BUILD_CSET; const char *SOURCEMOD_VERSION = SM_VERSION_STRING; const char *SOURCEMOD_BUILD_TIME = __DATE__ " " __TIME__; diff --git a/versionlib/versionlib.h b/versionlib/versionlib.h index bd2e0844b..065f3ff01 100644 --- a/versionlib/versionlib.h +++ b/versionlib/versionlib.h @@ -32,7 +32,8 @@ #if !defined(SM_USE_VERSIONLIB) // These get defined in sourcemod_version.h since // versionlib does not use versionlib. -# undef SOURCEMOD_BUILD_ID +# undef SOURCEMOD_LOCAL_REV +# undef SOURCEMOD_CSET # undef SOURCEMOD_VERSION # undef SOURCEMOD_BUILD_TIME #endif @@ -42,7 +43,8 @@ #else # define EXTERN_C extern #endif -EXTERN_C const char *SOURCEMOD_BUILD_ID; +EXTERN_C const char *SOURCEMOD_LOCAL_REV; +EXTERN_C const char *SOURCEMOD_SHA; EXTERN_C const char *SOURCEMOD_VERSION; EXTERN_C const char *SOURCEMOD_BUILD_TIME;