]> git.rkrishnan.org Git - tahoe-lafs/zfec.git/commitdiff
setup: reorder and extend show-tool-version.py, the better to glean information about...
authorzooko <zooko@zooko.com>
Tue, 4 May 2010 05:06:05 +0000 (10:36 +0530)
committerzooko <zooko@zooko.com>
Tue, 4 May 2010 05:06:05 +0000 (10:36 +0530)
Ignore-this: a3bbb6431a78ee2ac6e74d7f8b827932

darcs-hash:8e4f09dfcf8812608a42dfd0d185e8cbd8995104

misc/show-tool-versions.py

index 8fc838dc5a6b343c20febf9bb4b72b97929cb361..8f83403e7dbcd30708bdfa8d729e6ae60697a8bb 100755 (executable)
@@ -1,40 +1,59 @@
 #! /usr/bin/env python
 
-import sys
-import subprocess
+import os, subprocess, sys
+
+try:
+    import platform
+    out = platform.platform()
+    print
+    print "platform:", out.replace("\n", " ")
+except EnvironmentError, le:
+    sys.stderr.write("Got exception using 'platform': %s" % (le,))
+    pass
 
 print "python:", sys.version.replace("\n", " ") + ', maxunicode: ' + str(sys.maxunicode)
 
+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" % (le,))
+    pass
+
 try:
     out = subprocess.Popen(["buildbot", "--version"],
                            stdout=subprocess.PIPE).communicate()[0]
     print "buildbot:", out.replace("\n", " ")
-except EnvironmentError:
+except EnvironmentError, le:
+    sys.stderr.write("Got exception invoking 'buildbot': %s" % (le,))
     pass
 
 try:
-    out = subprocess.Popen(["darcs", "--version"],
+    out = subprocess.Popen(["cl"],
                            stdout=subprocess.PIPE).communicate()[0]
-    full = subprocess.Popen(["darcs", "--exact-version"],
-                            stdout=subprocess.PIPE).communicate()[0]
-    print
-    print "darcs:", out.replace("\n", " ")
-    print full.rstrip()
-except EnvironmentError:
+    print "cl:", out.replace("\n", " ")
+except EnvironmentError, le:
+    sys.stderr.write("Got exception invoking 'cl': %s" % (le,))
     pass
 
 try:
-    import platform
-    out = platform.platform()
-    print
-    print "platform:", out.replace("\n", " ")
-except EnvironmentError:
+    out = subprocess.Popen(["gcc", "--version"],
+                           stdout=subprocess.PIPE).communicate()[0]
+    print "gcc:", out.replace("\n", " ")
+except EnvironmentError, le:
+    sys.stderr.write("Got exception invoking 'gcc': %s" % (le,))
     pass
 
 try:
-    import pkg_resources
-    out = str(pkg_resources.require("setuptools"))
+    out = subprocess.Popen(["darcs", "--version"],
+                           stdout=subprocess.PIPE).communicate()[0]
+    full = subprocess.Popen(["darcs", "--exact-version"],
+                            stdout=subprocess.PIPE).communicate()[0]
     print
-    print "setuptools:", out.replace("\n", " ")
-except (ImportError, EnvironmentError):
+    print "darcs:", out.replace("\n", " ")
+    print full.rstrip()
+except EnvironmentError, le:
+    sys.stderr.write("Got exception invoking 'darcs': %s" % (le,))
     pass