[PATCH 2/3] builders: pass getproperties command as argv list

Anders Heimer <[email protected]>
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <[email protected]>
String commands are processed by the worker shell, which is fragile for
quoting and unnecessary when the command and arguments are already known.
Pass getproperties.py as an argv list so builddir and buildername values
are delivered as arguments without shell interpretation.

AI-Generated: Claude Opus 4.6 <[email protected]>
Signed-off-by: Anders Heimer <[email protected]>
---
 builders.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/builders.py b/builders.py
index 55f0769..418ef1b 100644
--- a/builders.py
+++ b/builders.py
@@ -141,7 +141,11 @@ def create_builder_factory():
     f.addStep(steps.JSONPropertiesDownload(workerdest="build-properties.json"))
 
     f.addStep(steps.SetPropertyFromCommand(
-        command=util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/getproperties.py %(prop:builddir)s/build %(prop:buildername)s"),
+        command=[
+            util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/getproperties.py"),
+            util.Interpolate("%(prop:builddir)s/build"),
+            util.Property("buildername"),
+        ],
         extract_fn=extract_json_props,
         name='Load build revisions',
         haltOnFailure=True))
@@ -364,7 +368,11 @@ def create_parent_builder_factory(buildername, waitname):
     factory.addStep(steps.JSONPropertiesDownload(workerdest="build-properties.json"))
 
     factory.addStep(steps.SetPropertyFromCommand(
-        command=util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/getproperties.py %(prop:builddir)s/build %(prop:buildername)s"),
+        command=[
+            util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/getproperties.py"),
+            util.Interpolate("%(prop:builddir)s/build"),
+            util.Property("buildername"),
+        ],
         extract_fn=extract_json_props,
         name='Load build revisions',
         haltOnFailure=True))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.