summaryrefslogtreecommitdiff
path: root/meta/classes/populate_sdk_ext.bbclass
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:15:22 +0000
commitfb625e555707478d5b4931c6bc83ab06b17a8ca9 (patch)
tree0c6016f177b20570b8b34bab72be46773b4047a3 /meta/classes/populate_sdk_ext.bbclass
parent9cab832b1e85822fa9be5ea9fa0415f48fba86f2 (diff)
downloadopenembedded-core-fb625e555707478d5b4931c6bc83ab06b17a8ca9.tar.gz
openembedded-core-fb625e555707478d5b4931c6bc83ab06b17a8ca9.tar.bz2
openembedded-core-fb625e555707478d5b4931c6bc83ab06b17a8ca9.zip
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/populate_sdk_ext.bbclass')
-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 () {
# Create local.conf
builddir = d.getVar('TOPDIR')
+ if derivative and os.path.exists(builddir + '/conf/auto.conf'):
+ shutil.copyfile(builddir + '/conf/auto.conf', baseoutpath + '/conf/auto.conf')
if derivative:
shutil.copyfile(builddir + '/conf/local.conf', baseoutpath + '/conf/local.conf')
else:
@@ -267,8 +269,12 @@ python copy_buildsystem () {
env_whitelist_values[varname] = origvalue
return origvalue, op, 0, True
varlist = ['[^#=+ ]*']
+ oldlines = []
+ if os.path.exists(builddir + '/conf/auto.conf'):
+ with open(builddir + '/conf/auto.conf', 'r') as f:
+ oldlines += f.readlines()
with open(builddir + '/conf/local.conf', 'r') as f:
- oldlines = f.readlines()
+ oldlines += f.readlines()
(updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
with open(baseoutpath + '/conf/local.conf', 'w') as f:
@@ -332,22 +338,6 @@ python copy_buildsystem () {
f.write('require conf/locked-sigs.inc\n')
f.write('require conf/unlocked-sigs.inc\n')
- if os.path.exists(builddir + '/conf/auto.conf'):
- if derivative:
- shutil.copyfile(builddir + '/conf/auto.conf', baseoutpath + '/conf/auto.conf')
- else:
- with open(builddir + '/conf/auto.conf', 'r') as f:
- oldlines = f.readlines()
- (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
- with open(baseoutpath + '/conf/auto.conf', 'w') as f:
- f.write('# WARNING: this configuration has been automatically generated and in\n')
- f.write('# most cases should not be edited. If you need more flexibility than\n')
- f.write('# this configuration provides, it is strongly suggested that you set\n')
- f.write('# up a proper instance of the full build system and use that instead.\n\n')
- for line in newlines:
- if line.strip() and not line.startswith('#'):
- f.write(line)
-
# Write a templateconf.cfg
with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f:
f.write('meta/conf\n')