Commit 1c193bb9 authored by Alexander Vickberg's avatar Alexander Vickberg Committed by Stefano Babic
Browse files

Fix use of config fragments



This is a Python port of the regular expressions used by
merge_config.sh to parse config fragments. The assembled config is
stored temporary in memory.
Signed-off-by: default avatarAlexander Vickberg <wickbergster@gmail.com>
parent 03aaa79e
......@@ -79,6 +79,8 @@ def find_cfgs(d):
return [s for s in src_patches(d, True) if s.endswith('.cfg')]
python () {
import re
try:
defconfig = bb.fetch2.localpath('file://defconfig', d)
except bb.fetch2.FetchError:
......@@ -89,9 +91,28 @@ python () {
except IOError:
return
features = configfile.readlines()
features = configfile.read()
configfile.close()
for current_fragment in find_cfgs(d):
try:
fragment_fd = open(current_fragment)
except IOError:
continue
fragment = fragment_fd.read()
fragment_fd.close()
fragment_search = re.findall('^(?:# )?(CONFIG_[a-zA-Z0-9_]*)[= ].*\n?', fragment, re.MULTILINE)
for feature in fragment_search:
features = re.sub("^(?:# )?" + feature + "[= ].*\n?", "", features, flags=re.MULTILINE)
features = features + fragment
features = features.splitlines(True)
depends = d.getVar('DEPENDS', False)
if 'CONFIG_REMOTE_HANDLER=y\n' in features:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment