From bcf1b092ae7540682a3295ce179fe910908ce90f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 14 Sep 2008 06:13:25 +0000 Subject: [PATCH] Mirrored buildbot/version template changes from branch. --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402539 --- core/sm_srvcmds.cpp | 1 + core/sm_version.tpl | 6 +++-- extensions/bintools/svn_version.tpl | 6 +++-- extensions/clientprefs/svn_version.tpl | 6 +++-- extensions/cstrike/svn_version.tpl | 6 +++-- extensions/geoip/svn_version.tpl | 6 +++-- extensions/mysql/svn_version.tpl | 6 +++-- extensions/regex/svn_version.tpl | 6 +++-- extensions/sdktools/svn_version.tpl | 6 +++-- extensions/sqlite/svn_version.tpl | 6 +++-- extensions/tf2/svn_version.tpl | 6 +++-- extensions/topmenus/svn_version.tpl | 6 +++-- loader/svn_version.tpl | 6 +++-- plugins/include/version.tpl | 2 +- plugins/testsuite/sqltest.sp | 36 +++++++++++++++++++++----- sourcepawn/compiler/svn_version.tpl | 6 +++-- sourcepawn/jit/jit_version.tpl | 6 +++-- tools/buildbot/bootstrap.pl | 2 +- tools/versionchanger.pl | 4 +++ 19 files changed, 92 insertions(+), 37 deletions(-) diff --git a/core/sm_srvcmds.cpp b/core/sm_srvcmds.cpp index 440f188e..3a838dc0 100644 --- a/core/sm_srvcmds.cpp +++ b/core/sm_srvcmds.cpp @@ -284,6 +284,7 @@ void RootConsoleMenu::OnRootConsoleCommand(const char *cmdname, const CCommand & ConsolePrint(" SourcePawn Engine: %s (build %s)", 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", SM_BUILD_UNIQUEID); ConsolePrint(" http://www.sourcemod.net/"); } } diff --git a/core/sm_version.tpl b/core/sm_version.tpl index c9d0c6a3..6b28661a 100644 --- a/core/sm_version.tpl +++ b/core/sm_version.tpl @@ -40,7 +40,9 @@ * @file Contains SourceMod version information. */ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/extensions/bintools/svn_version.tpl b/extensions/bintools/svn_version.tpl index e3c41e25..603604fc 100644 --- a/extensions/bintools/svn_version.tpl +++ b/extensions/bintools/svn_version.tpl @@ -36,7 +36,9 @@ #ifndef _INCLUDE_BINTOOLS_VERSION_H_ #define _INCLUDE_BINTOOLS_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_BINTOOLS_VERSION_H_ diff --git a/extensions/clientprefs/svn_version.tpl b/extensions/clientprefs/svn_version.tpl index 3ceaee29..326eca01 100644 --- a/extensions/clientprefs/svn_version.tpl +++ b/extensions/clientprefs/svn_version.tpl @@ -36,7 +36,9 @@ #ifndef _INCLUDE_CLIENTPREFS_VERSION_H_ #define _INCLUDE_CLIENTPREFS_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_CLIENTPREFS_VERSION_H_ diff --git a/extensions/cstrike/svn_version.tpl b/extensions/cstrike/svn_version.tpl index 3377580d..fa07e088 100644 --- a/extensions/cstrike/svn_version.tpl +++ b/extensions/cstrike/svn_version.tpl @@ -36,7 +36,9 @@ #ifndef _INCLUDE_SDKTOOLS_VERSION_H_ #define _INCLUDE_SDKTOOLS_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_SDKTOOLS_VERSION_H_ diff --git a/extensions/geoip/svn_version.tpl b/extensions/geoip/svn_version.tpl index d2d1d844..679a3732 100644 --- a/extensions/geoip/svn_version.tpl +++ b/extensions/geoip/svn_version.tpl @@ -36,7 +36,9 @@ #ifndef _INCLUDE_GEOIP_VERSION_H_ #define _INCLUDE_GEOIP_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_GEOIP_VERSION_H_ diff --git a/extensions/mysql/svn_version.tpl b/extensions/mysql/svn_version.tpl index 71e37adb..4badc53e 100644 --- a/extensions/mysql/svn_version.tpl +++ b/extensions/mysql/svn_version.tpl @@ -36,7 +36,9 @@ #ifndef _INCLUDE_MYSQLEXT_VERSION_H_ #define _INCLUDE_MYSQLEXT_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_MYSQLEXT_VERSION_H_ diff --git a/extensions/regex/svn_version.tpl b/extensions/regex/svn_version.tpl index 3cbf9f19..727d54ce 100644 --- a/extensions/regex/svn_version.tpl +++ b/extensions/regex/svn_version.tpl @@ -36,7 +36,9 @@ #ifndef _INCLUDE_REGEXEXT_VERSION_H_ #define _INCLUDE_REGEXEXT_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_REGEXEXT_VERSION_H_ diff --git a/extensions/sdktools/svn_version.tpl b/extensions/sdktools/svn_version.tpl index 2b1e90f2..e197ac1c 100644 --- a/extensions/sdktools/svn_version.tpl +++ b/extensions/sdktools/svn_version.tpl @@ -36,7 +36,9 @@ #ifndef _INCLUDE_SDKTOOLS_VERSION_H_ #define _INCLUDE_SDKTOOLS_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_SDKTOOLS_VERSION_H_ diff --git a/extensions/sqlite/svn_version.tpl b/extensions/sqlite/svn_version.tpl index 6d073779..566c386c 100644 --- a/extensions/sqlite/svn_version.tpl +++ b/extensions/sqlite/svn_version.tpl @@ -36,7 +36,9 @@ #ifndef _INCLUDE_SQLITEEXT_VERSION_H_ #define _INCLUDE_SQLITEEXT_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_SQLITEEXT_VERSION_H_ diff --git a/extensions/tf2/svn_version.tpl b/extensions/tf2/svn_version.tpl index d8f49c12..bf0be39f 100644 --- a/extensions/tf2/svn_version.tpl +++ b/extensions/tf2/svn_version.tpl @@ -36,7 +36,9 @@ #ifndef _INCLUDE_SDKTOOLS_VERSION_H_ #define _INCLUDE_SDKTOOLS_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_SDKTOOLS_VERSION_H_ diff --git a/extensions/topmenus/svn_version.tpl b/extensions/topmenus/svn_version.tpl index 86ee8200..9405f327 100644 --- a/extensions/topmenus/svn_version.tpl +++ b/extensions/topmenus/svn_version.tpl @@ -36,7 +36,9 @@ #ifndef _INCLUDE_SQLITEEXT_VERSION_H_ #define _INCLUDE_SQLITEEXT_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_SQLITEEXT_VERSION_H_ diff --git a/loader/svn_version.tpl b/loader/svn_version.tpl index 4c92c985..6b28661a 100644 --- a/loader/svn_version.tpl +++ b/loader/svn_version.tpl @@ -40,7 +40,9 @@ * @file Contains SourceMod version information. */ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/plugins/include/version.tpl b/plugins/include/version.tpl index f9a7db36..a09b9866 100644 --- a/plugins/include/version.tpl +++ b/plugins/include/version.tpl @@ -39,4 +39,4 @@ #define SOURCEMOD_V_MINOR $PMINOR$ /**< SourceMod Minor version */ #define SOURCEMOD_V_RELEASE $PREVISION$ /**< SourceMod Release version */ -#define SOURCEMOD_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" /**< SourceMod version string (major.minor.release.build) */ +#define SOURCEMOD_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" /**< SourceMod version string (major.minor.release.build) */ diff --git a/plugins/testsuite/sqltest.sp b/plugins/testsuite/sqltest.sp index 71e20179..a1d5190e 100644 --- a/plugins/testsuite/sqltest.sp +++ b/plugins/testsuite/sqltest.sp @@ -62,7 +62,7 @@ public Action:Command_TestSql1(args) return Plugin_Handled } - new Handle:query = SQL_Query(db, "SELECT * FROM gaben") + new Handle:query = SQL_Query(db, "SELECT * FROM gab") if (query == INVALID_HANDLE) { SQL_GetError(db, error, sizeof(error)) @@ -87,7 +87,7 @@ public Action:Command_TestSql2(args) return Plugin_Handled } - new Handle:stmt = SQL_PrepareQuery(db, "SELECT * FROM gaben WHERE gaben > ?", error, sizeof(error)) + new Handle:stmt = SQL_PrepareQuery(db, "SELECT * FROM gab WHERE gaben > ?", error, sizeof(error)) if (stmt == INVALID_HANDLE) { PrintToServer("Failed to prepare query: %s", error) @@ -141,7 +141,7 @@ public Action:Command_TestSql3(args) public Action:Command_TestSql4(args) { SQL_LockDatabase(g_ThreadedHandle); - new Handle:query = SQL_Query(g_ThreadedHandle, "SELECT * FROM gaben") + new Handle:query = SQL_Query(g_ThreadedHandle, "SELECT * FROM gab") if (query == INVALID_HANDLE) { new String:error[255]; @@ -163,15 +163,37 @@ public CallbackTest5(Handle:owner, Handle:hndl, const String:error[], any:data) PrintToServer("Failed to query: %s", error) } else { PrintQueryData(hndl) + SQL_TQuery(g_ThreadedHandle, CallbackTest6, "UPDATE gab SET `gaben` = `gaben` + 1 WHERE `gaben` >= 4", 52) + } +} + +public CallbackTest6(Handle:owner, Handle:hndl, const String:error[], any:data) +{ + if (hndl == INVALID_HANDLE) + { + PrintToServer("Failed to query: %s", error) + } else { + PrintToServer("Queried!"); + SQL_TQuery(g_ThreadedHandle, CallbackTest7, "UPDATE gab SET `gaben` = `gaben` + 1 WHERE `gaben` >= 4", 52) + } +} + +public CallbackTest7(Handle:owner, Handle:hndl, const String:error[], any:data) +{ + if (hndl == INVALID_HANDLE) + { + PrintToServer("Failed to query: %s", error) + } else { + PrintToServer("Queried!"); } } public Action:Command_TestSql5(args) { - SQL_TQuery(g_ThreadedHandle, CallbackTest5, "SELECT * FROM gaben", 52) - SQL_TQuery(g_ThreadedHandle, CallbackTest5, "SELECT * FROM gaben", 52) - SQL_TQuery(g_ThreadedHandle, CallbackTest5, "SELECT * FROM gaben", 52) - SQL_TQuery(g_ThreadedHandle, CallbackTest5, "SELECT * FROM gaben", 52) + SQL_TQuery(g_ThreadedHandle, CallbackTest5, "SELECT * FROM gab", 52) + SQL_TQuery(g_ThreadedHandle, CallbackTest5, "SELECT * FROM gab", 52) + SQL_TQuery(g_ThreadedHandle, CallbackTest5, "SELECT * FROM gab", 52) + SQL_TQuery(g_ThreadedHandle, CallbackTest5, "SELECT * FROM gab", 52) return Plugin_Handled; } diff --git a/sourcepawn/compiler/svn_version.tpl b/sourcepawn/compiler/svn_version.tpl index c74e8570..902b4393 100644 --- a/sourcepawn/compiler/svn_version.tpl +++ b/sourcepawn/compiler/svn_version.tpl @@ -19,7 +19,9 @@ * @file Contains SourceMod version information. */ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$LOCAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/sourcepawn/jit/jit_version.tpl b/sourcepawn/jit/jit_version.tpl index 03f9ba90..a154d6d4 100644 --- a/sourcepawn/jit/jit_version.tpl +++ b/sourcepawn/jit/jit_version.tpl @@ -32,7 +32,9 @@ #ifndef _INCLUDE_JIT_VERSION_H_ #define _INCLUDE_JIT_VERSION_H_ -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$-svn" -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$LOCAL_BUILD$ +#define SM_BUILD_STRING "$BUILD_STRING$" +#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 #endif //_INCLUDE_JIT_VERSION_H_ diff --git a/tools/buildbot/bootstrap.pl b/tools/buildbot/bootstrap.pl index 71ed1a65..6c4ba96a 100755 --- a/tools/buildbot/bootstrap.pl +++ b/tools/buildbot/bootstrap.pl @@ -57,4 +57,4 @@ if ($^O eq "linux") Build::Command("flip -u tools/versionchanger.pl"); Build::Command("chmod +x tools/versionchanger.pl"); } -Build::Command(Build::PathFormat('tools/versionchanger.pl')); +Build::Command(Build::PathFormat('tools/versionchanger.pl') . ' --buildstring="-dev"'); diff --git a/tools/versionchanger.pl b/tools/versionchanger.pl index a8457e93..23638d0e 100644 --- a/tools/versionchanger.pl +++ b/tools/versionchanger.pl @@ -9,6 +9,7 @@ our %arguments = 'build' => undef, 'svnrev' => 'global', 'path' => '', + 'buildstring' => '', ); my $arg; @@ -92,6 +93,7 @@ my $major = $arguments{'major'}; my $minor = $arguments{'minor'}; my $revision = $arguments{'revision'}; my $svnrev = $arguments{'svnrev'}; +my $buildstr = $arguments{'buildstring'}; #Go through everything now my $mod_i; @@ -135,6 +137,8 @@ while ( ($cur_module, $mod_i) = each(%modules) ) s/\$PREVISION\$/$revision/g; s/\$GLOBAL_BUILD\$/$rev/g; s/\$LOCAL_BUILD\$/$local_rev/g; + s/\$BUILD_ID\$/$rev/g; + s/\$BUILD_STRING\$/$buildstr/g; print OUTFILE $_; } close(OUTFILE);