[yocto-autobuilder-helper,2/2] setup-config: Add multiconfig setup support

Submitted by aaron.chun.yew.chan@intel.com on March 24, 2020, 12:27 a.m. | Patch ID: 171245

Details

Message ID 20200324002710.13224-2-aaron.chun.yew.chan@intel.com
State New
Headers show

Commit Message

aaron.chun.yew.chan@intel.com March 24, 2020, 12:27 a.m.
From: Aaron Chan <aaron.chun.yew.chan@intel.com>

Signed-off-by: Aaron Chan <aaron.chun.yew.chan@intel.com>
---
 scripts/setup-config | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Patch hide | download patch | download mbox

diff --git a/scripts/setup-config b/scripts/setup-config
index 3c8862a..c006297 100755
--- a/scripts/setup-config
+++ b/scripts/setup-config
@@ -9,6 +9,7 @@  import sys
 import subprocess
 import errno
 import copy
+import re
 
 import utils
 
@@ -119,3 +120,19 @@  with open(sdkextraconf, "w") as f:
         print("  " + v)
         f.write(v + "\n")
 
+# Add multiconfig setup support
+multivars=utils.getconfigexpr("multi-(.*)", ourconfig, args.target, stepnum)
+if multivars:
+    for conf in multivars:
+        mvars=utils.getconfiglistfilter(conf, ourconfig, args.target, stepnum)
+        m=re.search("multi-(.*)", conf)
+        mpath=os.path.join(args.builddir, "conf", "multiconfig")
+        mfile=os.path.join(mpath, "%s.conf" % m.group(1))
+        os.makedirs(mpath, exist_ok=True)
+        if os.path.exists(mfile):
+            os.remove(mfile)
+        utils.printheader("Writing %s with contents:" % mfile)
+        with open(mfile, 'w') as f:
+            for v in mvars:
+                print("  " + v)
+                f.write(v + "\n")