summaryrefslogtreecommitdiff
path: root/misc/build_helpers
diff options
context:
space:
mode:
authorZooko O'Whielacronx <zooko@zooko.com>2010-06-06 21:29:09 -0800
committerZooko O'Whielacronx <zooko@zooko.com>2010-06-06 21:29:09 -0800
commitd7909cb12994c892c08ba4cafe9b3eafbe7aa7ec (patch)
tree0e18314b489474205cfad9e8824e00cbb3487278 /misc/build_helpers
parent732e8dea153b3594c57a2b2d319045913a5b1b67 (diff)
setup: reorganize misc/ to match Tahoe-LAFS's misc/ so that the same buildmaster config can use pycryptopp's and Tahoe-LAFS's
Diffstat (limited to 'misc/build_helpers')
-rw-r--r--misc/build_helpers/run_trial.py1
-rw-r--r--misc/build_helpers/show-tool-versions.py86
2 files changed, 87 insertions, 0 deletions
diff --git a/misc/build_helpers/run_trial.py b/misc/build_helpers/run_trial.py
new file mode 100644
index 0000000..4d06a5d
--- /dev/null
+++ b/misc/build_helpers/run_trial.py
@@ -0,0 +1 @@
+from twisted.scripts.trial import run; run() \ No newline at end of file
diff --git a/misc/build_helpers/show-tool-versions.py b/misc/build_helpers/show-tool-versions.py
new file mode 100644
index 0000000..30162d4
--- /dev/null
+++ b/misc/build_helpers/show-tool-versions.py
@@ -0,0 +1,86 @@
+#! /usr/bin/env python
+
+import os, subprocess, sys
+
+def print_platform():
+ try:
+ import platform
+ out = platform.platform()
+ print
+ print "platform:", out.replace("\n", " ")
+ except EnvironmentError, le:
+ sys.stderr.write("Got exception using 'platform': %s\n" % (le,))
+ pass
+
+def print_python_ver():
+ print "python:", sys.version.replace("\n", " ") + ', maxunicode: ' + str(sys.maxunicode)
+
+def print_cmd_ver(cmdlist, label=None):
+ try:
+ res = subprocess.Popen(cmdlist, stdin=open(os.devnull),
+ stdout=subprocess.PIPE).communicate()[0]
+ if label is None:
+ label = cmdlist[0]
+ print
+ print label + ': ' + res.replace("\n", " ")
+ except EnvironmentError, le:
+ sys.stderr.write("Got exception invoking '%s': %s\n" % (cmdlist[0], le,))
+ pass
+
+def print_as_ver():
+ if os.path.exists('a.out'):
+ print
+ print "WARNING: a file named a.out exists, and getting the version of the 'as' assembler writes to that filename, so I'm not attempting to get the version of 'as'."
+ return
+ try:
+ res = subprocess.Popen(['as', '-version'], stdin=open(os.devnull),
+ stderr=subprocess.PIPE).communicate()[1]
+ print
+ print 'as: ' + res.replace("\n", " ")
+ os.remove('a.out')
+ except EnvironmentError, le:
+ sys.stderr.write("Got exception invoking '%s': %s\n" % ('as', le,))
+ pass
+
+def print_setuptools_ver():
+ try:
+ import pkg_resources
+ out = str(pkg_resources.require("setuptools"))
+ print
+ print "setuptools:", out.replace("\n", " ")
+ except (ImportError, EnvironmentError), le:
+ sys.stderr.write("Got exception using 'pkg_resources' to get the version of setuptools: %s\n" % (le,))
+ pass
+
+def print_py_pkg_ver(pkgname):
+ try:
+ import pkg_resources
+ out = str(pkg_resources.require(pkgname))
+ print
+ print pkgname + ': ' + out.replace("\n", " ")
+ except (ImportError, EnvironmentError), le:
+ sys.stderr.write("Got exception using 'pkg_resources' to get the version of %s: %s\n" % (pkgname, le,))
+ pass
+ except pkg_resources.DistributionNotFound, le:
+ sys.stderr.write("pkg_resources reported no %s package installed: %s\n" % (pkgname, le,))
+ pass
+
+print_platform()
+
+print_python_ver()
+
+print_cmd_ver(['buildbot', '--version'])
+print_cmd_ver(['cl'])
+print_cmd_ver(['g++', '--version'])
+print_cmd_ver(['cryptest', 'V'])
+print_cmd_ver(['darcs', '--version'])
+print_cmd_ver(['darcs', '--exact-version'], label='darcs-exact-version')
+print_cmd_ver(['7za'])
+
+print_as_ver()
+
+print_setuptools_ver()
+
+print_py_pkg_ver('coverage')
+print_py_pkg_ver('trialcoverage')
+print_py_pkg_ver('setuptools_trial')