|
@@ -69,16 +69,23 @@ def add_to_feat_cnf(feature, flines):
|
69
|
69
|
except:
|
70
|
70
|
FEATURE_CONFIG[feature] = {}
|
71
|
71
|
|
|
72
|
+ # Get a reference to the FEATURE_CONFIG under construction
|
72
|
73
|
feat = FEATURE_CONFIG[feature]
|
73
|
|
- atoms = re.sub(',\\s*', '\n', flines).strip().split('\n')
|
74
|
|
- for dep in atoms:
|
75
|
|
- parts = dep.split('=')
|
|
74
|
+
|
|
75
|
+ # Split up passed lines on commas or newlines and iterate
|
|
76
|
+ # Add common options to the features config under construction
|
|
77
|
+ # For lib_deps replace a previous instance of the same library
|
|
78
|
+ atoms = re.sub(r',\\s*', '\n', flines).strip().split('\n')
|
|
79
|
+ for line in atoms:
|
|
80
|
+ parts = line.split('=')
|
76
|
81
|
name = parts.pop(0)
|
77
|
|
- rest = '='.join(parts)
|
78
|
82
|
if name in ['build_flags', 'extra_scripts', 'src_filter', 'lib_ignore']:
|
79
|
|
- feat[name] = rest
|
|
83
|
+ feat[name] = '='.join(parts)
|
80
|
84
|
else:
|
81
|
|
- feat['lib_deps'] += [dep]
|
|
85
|
+ for dep in line.split(','):
|
|
86
|
+ lib_name = re.sub(r'([@~^=]|[<>]=?)[\d.]+', '', dep.strip()).split('=').pop(0)
|
|
87
|
+ lib_re = re.compile('(?!^' + lib_name + '\\b)')
|
|
88
|
+ feat['lib_deps'] = list(filter(lib_re.match, feat['lib_deps'])) + [dep]
|
82
|
89
|
|
83
|
90
|
def load_config():
|
84
|
91
|
config = configparser.ConfigParser()
|
|
@@ -185,8 +192,8 @@ def apply_features_config():
|
185
|
192
|
blab("Adding src_filter for %s... " % feature)
|
186
|
193
|
src_filter = ' '.join(env.GetProjectOption('src_filter'))
|
187
|
194
|
# first we need to remove the references to the same folder
|
188
|
|
- my_srcs = re.findall( r'[+-](<.*?>)', feat['src_filter'])
|
189
|
|
- cur_srcs = re.findall( r'[+-](<.*?>)', src_filter)
|
|
195
|
+ my_srcs = re.findall(r'[+-](<.*?>)', feat['src_filter'])
|
|
196
|
+ cur_srcs = re.findall(r'[+-](<.*?>)', src_filter)
|
190
|
197
|
for d in my_srcs:
|
191
|
198
|
if d in cur_srcs:
|
192
|
199
|
src_filter = re.sub(r'[+-]' + d, '', src_filter)
|