[151030] contrib/buildbot-test/master.cfg

cal at macports.org cal at macports.org
Fri Aug 5 12:55:52 PDT 2016


Revision: 151030
          https://trac.macports.org/changeset/151030
Author:   cal at macports.org
Date:     2016-08-05 12:55:51 -0700 (Fri, 05 Aug 2016)
Log Message:
-----------
buildbot: Use mpbb list-subports, ignore stderr

Switch to ./mpbb list-subports over the older subports.tcl script. This has the
advantage of avoiding a loop, because that loop is now handled in mpbb.

Additionally, ignore output written to stderr and do not interpret it as port
name. Buildbot 0.8.x by default includes stderr while parsing the result and
the Portfiles we run in this step can print arbitrary strings to stderr.
Buildbot 0.9.x has a fix for this, but fortunately we can work around the
problem with the 0.8.x feature set as well.

Modified Paths:
--------------
    contrib/buildbot-test/master.cfg

Modified: contrib/buildbot-test/master.cfg
===================================================================
--- contrib/buildbot-test/master.cfg	2016-08-05 19:48:56 UTC (rev 151029)
+++ contrib/buildbot-test/master.cfg	2016-08-05 19:55:51 UTC (rev 151030)
@@ -306,9 +306,26 @@
         description="checkout",
         haltOnFailure=True))
 
+    def extract_subportlist(rc, stdout, stderr):
+        """
+        Extract function for SetPropertyFromCommand(). Buildbot did not get the
+        capability to ignore or distinguish stderr output before 0.9.x, but
+        extract_fn always had the option to deal with them separately, so do
+        that.
+
+        This is called by SetPropertyFromCommand with the return value of the
+        command and strings containing stdout and stderr. The return value
+        should be a dictionary of new properties to be set.
+        """
+        if rc != 0:
+            # Set an empty subport list on error
+            return {"subportlist": ""}
+        subports = [x.strip() for x in stdout.splitlines()]
+        return {"subportlist": " ".join(subports)}
+
     portwatcher_factory.addStep(SetPropertyFromCommandWithPortlist(
-        command=WithProperties('for portname in %(fullportlist)s; do for subport in $(./mpbb/mpbb subports --port "$portname"); do echo $subport; done; done'),
-        property="subportlist",
+        command=WithProperties('./mpbb/mpbb list-subports %(fullportlist)s'),
+        extract_fn=extract_subportlist,
         name="subports",
         description="subports"))
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160805/c7e45e34/attachment.html>


More information about the macports-changes mailing list