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 to parse config fragments. The assembled config is
stored temporary in memory.
Signed-off-by: default avatarAlexander Vickberg <>
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
defconfig = bb.fetch2.localpath('file://defconfig', d)
except bb.fetch2.FetchError:
......@@ -89,9 +91,28 @@ python () {
except IOError:
features = configfile.readlines()
features =
for current_fragment in find_cfgs(d):
fragment_fd = open(current_fragment)
except IOError:
fragment =
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