From 461b12c1d3157baa673d6520f523edd39fe5aac5 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Thu, 19 Feb 2009 00:24:36 -0700
Subject: [PATCH] setup.py: add show_tool_versions command, for the benefit of
 a new buildbot step

---
 setup.py | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/setup.py b/setup.py
index e30294c6..92e89412 100644
--- a/setup.py
+++ b/setup.py
@@ -304,6 +304,33 @@ class MySdist(sdist.sdist):
 
         return sdist.sdist.make_distribution(self)
 
+class ToolVersions(Command):
+    user_options = []
+    def initialize_options(self):
+        pass
+    def finalize_options(self):
+        pass
+    def run(self):
+        print "python:", sys.version.replace("\n", " ")
+
+        try:
+            out = subprocess.Popen(["buildbot", "--version"],
+                                   stdout=subprocess.PIPE).communicate()[0]
+            print "buildbot:", out.replace("\n", " ")
+        except OSError:
+            pass
+
+        try:
+            out = subprocess.Popen(["darcs", "--version"],
+                                   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 OSError:
+            pass
+
 # Tahoe's dependencies are managed by the find_links= entry in setup.cfg and
 # the _auto_deps.install_requires list, which is used in the call to setup()
 # below.
@@ -334,6 +361,7 @@ setup(name=APPNAME,
                 "run_with_pythonpath": RunWithPythonPath,
                 "check_auto_deps": CheckAutoDeps,
                 "make_executable": MakeExecutable,
+                "show_tool_versions": ToolVersions,
                 "sdist": MySdist,
                 },
       package_dir = {'':'src'},
-- 
2.45.2