diff options
Diffstat (limited to 'Modules/getbuildinfo.c')
-rw-r--r-- | Modules/getbuildinfo.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index 8b1ca22..7343a0f 100644 --- a/Modules/getbuildinfo.c +++ b/Modules/getbuildinfo.c @@ -20,21 +20,30 @@ #endif #endif -#ifndef BUILD -#define BUILD "0" -#endif +static const char revision[] = "$Revision$"; +static const char headurl[] = "$HeadURL$"; const char * Py_GetBuildInfo(void) { static char buildinfo[50]; +#ifdef SVNVERSION + static char svnversion[] = SVNVERSION; +#else + static char svnversion[20] = "unknown"; + if (strstr(headurl, "/tags/") != NULL) { + int start = ; + strncpy(svnversion, revision+start, stop-start); + svnversion[stop-start] = '\0'; + } +#endif PyOS_snprintf(buildinfo, sizeof(buildinfo), - "%s, %.20s, %.9s", BUILD, DATE, TIME); + "%s, %.20s, %.9s", svnversion, DATE, TIME); return buildinfo; } const char * Py_GetBuildNumber(void) { - return BUILD; + return "0"; } |