2001-12-03 21:11:32 -04:00
|
|
|
#include "Python.h"
|
1997-05-20 19:40:26 -03:00
|
|
|
|
1999-08-27 17:39:37 -03:00
|
|
|
#ifndef DONT_HAVE_STDIO_H
|
1997-01-20 14:34:26 -04:00
|
|
|
#include <stdio.h>
|
1999-08-27 17:39:37 -03:00
|
|
|
#endif
|
1997-01-20 14:34:26 -04:00
|
|
|
|
|
|
|
#ifndef DATE
|
|
|
|
#ifdef __DATE__
|
|
|
|
#define DATE __DATE__
|
|
|
|
#else
|
|
|
|
#define DATE "xx/xx/xx"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef TIME
|
|
|
|
#ifdef __TIME__
|
|
|
|
#define TIME __TIME__
|
|
|
|
#else
|
|
|
|
#define TIME "xx:xx:xx"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2007-06-07 20:53:49 -03:00
|
|
|
/* on unix, SVNVERSION is passed on the command line.
|
|
|
|
* on Windows, the string is interpolated using
|
|
|
|
* subwcrev.exe
|
|
|
|
*/
|
|
|
|
#ifndef SVNVERSION
|
2006-01-18 05:13:51 -04:00
|
|
|
#define SVNVERSION "$WCRANGE$$WCMODS?M:$"
|
2007-06-07 20:53:49 -03:00
|
|
|
#endif
|
|
|
|
|
2005-12-17 21:27:35 -04:00
|
|
|
const char *
|
2005-12-18 18:46:35 -04:00
|
|
|
Py_GetBuildInfo(void)
|
2005-12-17 21:27:35 -04:00
|
|
|
{
|
2005-12-18 18:46:35 -04:00
|
|
|
static char buildinfo[50];
|
2006-01-05 22:45:17 -04:00
|
|
|
const char *revision = Py_SubversionRevision();
|
|
|
|
const char *sep = *revision ? ":" : "";
|
|
|
|
const char *branch = Py_SubversionShortBranch();
|
2005-12-18 18:46:35 -04:00
|
|
|
PyOS_snprintf(buildinfo, sizeof(buildinfo),
|
2006-01-05 19:38:54 -04:00
|
|
|
"%s%s%s, %.20s, %.9s", branch, sep, revision,
|
|
|
|
DATE, TIME);
|
2005-12-18 18:46:35 -04:00
|
|
|
return buildinfo;
|
2005-12-17 21:27:35 -04:00
|
|
|
}
|
2005-12-19 10:43:44 -04:00
|
|
|
|
|
|
|
const char *
|
2006-01-05 19:38:54 -04:00
|
|
|
_Py_svnversion(void)
|
2005-12-19 10:43:44 -04:00
|
|
|
{
|
2007-04-30 12:17:46 -03:00
|
|
|
/* the following string can be modified by subwcrev.exe */
|
|
|
|
static const char svnversion[] = SVNVERSION;
|
2007-06-07 20:53:49 -03:00
|
|
|
if (svnversion[0] != '$')
|
|
|
|
return svnversion; /* it was interpolated, or passed on command line */
|
2009-05-23 16:24:37 -03:00
|
|
|
return "Unversioned directory";
|
2005-12-19 10:43:44 -04:00
|
|
|
}
|