summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-03 11:13:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-03 11:16:12 +0000
commit32e1eac49201fb57ca0d26ef3d2012f7e8573663 (patch)
tree94e231788cacf2be59152dcc46873e8c7f026a17 /meta/classes
parent7fefdc1e11ecbfafe36e232a57c08d1a31dae6c9 (diff)
downloadpoky-32e1eac49201fb57ca0d26ef3d2012f7e8573663.tar.gz
populate_ext_sdk: Merge auto.conf into local.conf
auto.conf is included before local.conf. Instead of keeping them separate, merge them into the extsdk local.conf. As it happens we can do this quite neatly, more neatly than the current code IMO and it makes the configuration easier for the end user to understand too. This means auto.conf is then available for the testsdk code to use for testing purposes. (From OE-Core rev: fb625e555707478d5b4931c6bc83ab06b17a8ca9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/populate_sdk_ext.bbclass24
1 files changed, 7 insertions, 17 deletions
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index fb38ebc1f1..3bccb142e6 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -253,6 +253,8 @@ python copy_buildsystem () {
253 253
254 # Create local.conf 254 # Create local.conf
255 builddir = d.getVar('TOPDIR') 255 builddir = d.getVar('TOPDIR')
256 if derivative and os.path.exists(builddir + '/conf/auto.conf'):
257 shutil.copyfile(builddir + '/conf/auto.conf', baseoutpath + '/conf/auto.conf')
256 if derivative: 258 if derivative:
257 shutil.copyfile(builddir + '/conf/local.conf', baseoutpath + '/conf/local.conf') 259 shutil.copyfile(builddir + '/conf/local.conf', baseoutpath + '/conf/local.conf')
258 else: 260 else:
@@ -267,8 +269,12 @@ python copy_buildsystem () {
267 env_whitelist_values[varname] = origvalue 269 env_whitelist_values[varname] = origvalue
268 return origvalue, op, 0, True 270 return origvalue, op, 0, True
269 varlist = ['[^#=+ ]*'] 271 varlist = ['[^#=+ ]*']
272 oldlines = []
273 if os.path.exists(builddir + '/conf/auto.conf'):
274 with open(builddir + '/conf/auto.conf', 'r') as f:
275 oldlines += f.readlines()
270 with open(builddir + '/conf/local.conf', 'r') as f: 276 with open(builddir + '/conf/local.conf', 'r') as f:
271 oldlines = f.readlines() 277 oldlines += f.readlines()
272 (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var) 278 (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
273 279
274 with open(baseoutpath + '/conf/local.conf', 'w') as f: 280 with open(baseoutpath + '/conf/local.conf', 'w') as f:
@@ -332,22 +338,6 @@ python copy_buildsystem () {
332 f.write('require conf/locked-sigs.inc\n') 338 f.write('require conf/locked-sigs.inc\n')
333 f.write('require conf/unlocked-sigs.inc\n') 339 f.write('require conf/unlocked-sigs.inc\n')
334 340
335 if os.path.exists(builddir + '/conf/auto.conf'):
336 if derivative:
337 shutil.copyfile(builddir + '/conf/auto.conf', baseoutpath + '/conf/auto.conf')
338 else:
339 with open(builddir + '/conf/auto.conf', 'r') as f:
340 oldlines = f.readlines()
341 (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
342 with open(baseoutpath + '/conf/auto.conf', 'w') as f:
343 f.write('# WARNING: this configuration has been automatically generated and in\n')
344 f.write('# most cases should not be edited. If you need more flexibility than\n')
345 f.write('# this configuration provides, it is strongly suggested that you set\n')
346 f.write('# up a proper instance of the full build system and use that instead.\n\n')
347 for line in newlines:
348 if line.strip() and not line.startswith('#'):
349 f.write(line)
350
351 # Write a templateconf.cfg 341 # Write a templateconf.cfg
352 with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f: 342 with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f:
353 f.write('meta/conf\n') 343 f.write('meta/conf\n')