summaryrefslogtreecommitdiff
path: root/sys/src/cmd/python/Modules/getbuildinfo.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
commit458120dd40db6b4df55a4e96b650e16798ef06a0 (patch)
tree8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/src/cmd/python/Modules/getbuildinfo.c
parent3a742c699f6806c1145aea5149bf15de15a0afd7 (diff)
add hg and python
Diffstat (limited to 'sys/src/cmd/python/Modules/getbuildinfo.c')
-rw-r--r--sys/src/cmd/python/Modules/getbuildinfo.c48
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
+}