diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
commit | 458120dd40db6b4df55a4e96b650e16798ef06a0 (patch) | |
tree | 8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/src/cmd/python/Modules/getbuildinfo.c | |
parent | 3a742c699f6806c1145aea5149bf15de15a0afd7 (diff) |
add hg and python
Diffstat (limited to 'sys/src/cmd/python/Modules/getbuildinfo.c')
-rw-r--r-- | sys/src/cmd/python/Modules/getbuildinfo.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/sys/src/cmd/python/Modules/getbuildinfo.c b/sys/src/cmd/python/Modules/getbuildinfo.c new file mode 100644 index 000000000..a017dab06 --- /dev/null +++ b/sys/src/cmd/python/Modules/getbuildinfo.c @@ -0,0 +1,48 @@ +#include "Python.h" + +#ifndef DONT_HAVE_STDIO_H +#include <stdio.h> +#endif + +#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 + +#ifdef SUBWCREV +#define SVNVERSION "$WCRANGE$$WCMODS?M:$" +#endif + +const char * +Py_GetBuildInfo(void) +{ + static char buildinfo[50]; + const char *revision = Py_SubversionRevision(); + const char *sep = *revision ? ":" : ""; + const char *branch = Py_SubversionShortBranch(); + PyOS_snprintf(buildinfo, sizeof(buildinfo), + "%s%s%s, %.20s, %.9s", branch, sep, revision, + DATE, TIME); + return buildinfo; +} + +const char * +_Py_svnversion(void) +{ +#ifdef SVNVERSION + return SVNVERSION; +#else + return "exported"; +#endif +} |