]> code.ossystems Code Review - openembedded-core.git/commitdiff
populate_sdk_ext: enable custom templateconf.cfg
authorAndrej Valek <andrej.valek@siemens.com>
Fri, 6 Mar 2020 15:32:33 +0000 (16:32 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 7 Mar 2020 10:04:43 +0000 (10:04 +0000)
Do not always override templateconf.cfg content. Add option to use
already existing file.

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/populate_sdk_ext.bbclass

index 57fd29b1bbd1fd3862a3f3b4bb3c79b299fa050b..9f26cfc13168787182d6e512614a4c288f02f190 100644 (file)
@@ -388,9 +388,13 @@ python copy_buildsystem () {
         bb.utils.mkdirhier(os.path.join(baseoutpath, 'cache'))
         shutil.copyfile(builddir + '/cache/bb_unihashes.dat', baseoutpath + '/cache/bb_unihashes.dat')
 
-    # Write a templateconf.cfg
-    with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f:
-        f.write('meta/conf\n')
+    # Use templateconf.cfg file from builddir if exists
+    if os.path.exists(builddir + '/conf/templateconf.cfg'):
+        shutil.copyfile(builddir + '/conf/templateconf.cfg', baseoutpath + '/conf/templateconf.cfg')
+    else:
+        # Write a templateconf.cfg
+        with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f:
+            f.write('meta/conf\n')
 
     # Ensure any variables set from the external environment (by way of
     # BB_ENV_EXTRAWHITE) are set in the SDK's configuration