@@ -8,8 +8,9 @@ import sys
import utils
+# Usage: scripts/getproperties.py <builddir> [builder_name]
builddir = sys.argv[1]
-
+targetname = sys.argv[2] if len(sys.argv) > 2 else None
with open(builddir + "/../layerinfo.json") as f:
repos = json.load(f)
@@ -71,5 +72,22 @@ buildid = hashlib.sha1(buildid.encode("utf-8")).hexdigest()
jsonprops['yp_build_revision'] = buildid
-print(json.dumps(jsonprops, indent=4, sort_keys=True))
+ourconfig = utils.loadconfig()
+exported_properties = ['DISTRO', 'MACHINE', 'SDKMACHINE', 'PACKAGE_CLASSES']
+if targetname in ourconfig['overrides']:
+ target_props = {}
+ target = ourconfig['overrides'][targetname]
+ maxsteps = 1
+ for v in target:
+ if v.startswith("step"):
+ # Get properties values for this build step, falling back to
+ # defaults if they are not set.
+ for prop in exported_properties:
+ for propdict in (target[v], target, ourconfig['defaults']):
+ if prop in propdict:
+ target_props.setdefault(prop, set()).add(propdict[prop])
+ break
+ for k, v in target_props.items():
+ jsonprops[k] = list(v)[0] if len(v) == 1 else list(v)
+print(json.dumps(jsonprops, indent=4, sort_keys=True))
Extract some important build configuration values, allowing to add them to buildbot properties. This includes MACHINE, DISTRO, SDKMACHINE and PACKAGE_CLASSES. Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> --- scripts/getproperties.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)