diff options
Diffstat (limited to 'bitbake/lib/bb/parse')
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 49a0788038..cfead466e1 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -364,7 +364,8 @@ class AddFragmentsNode(AstNode): | |||
364 | def check_and_set_builtin_fragment(fragment, data, builtin_fragments): | 364 | def check_and_set_builtin_fragment(fragment, data, builtin_fragments): |
365 | prefix, value = fragment.split('/', 1) | 365 | prefix, value = fragment.split('/', 1) |
366 | if prefix in builtin_fragments.keys(): | 366 | if prefix in builtin_fragments.keys(): |
367 | data.setVar(builtin_fragments[prefix], value) | 367 | # parsing=True since we want to emulate X=Y and allow X:override=Z to continue to exist |
368 | data.setVar(builtin_fragments[prefix], value, parsing=True) | ||
368 | return True | 369 | return True |
369 | return False | 370 | return False |
370 | 371 | ||
@@ -375,6 +376,27 @@ class AddFragmentsNode(AstNode): | |||
375 | 376 | ||
376 | if not fragments: | 377 | if not fragments: |
377 | return | 378 | return |
379 | |||
380 | # Check for multiple builtin fragments setting the same variable | ||
381 | for builtin_fragment_key in builtin_fragments.keys(): | ||
382 | builtin_fragments_list = list( | ||
383 | filter( | ||
384 | lambda f: f.startswith(builtin_fragment_key + "/"), | ||
385 | fragments.split(), | ||
386 | ) | ||
387 | ) | ||
388 | if len(builtin_fragments_list) > 1: | ||
389 | bb.warn( | ||
390 | ("Multiple builtin fragments are enabled for %s via variable %s: %s. " | ||
391 | "This likely points to a mis-configuration in the metadata, as only " | ||
392 | "one of them should be set. The build will use the last value.") | ||
393 | % ( | ||
394 | builtin_fragment_key, | ||
395 | self.fragments_variable, | ||
396 | " ".join(builtin_fragments_list), | ||
397 | ) | ||
398 | ) | ||
399 | |||
378 | for f in fragments.split(): | 400 | for f in fragments.split(): |
379 | if check_and_set_builtin_fragment(f, data, builtin_fragments): | 401 | if check_and_set_builtin_fragment(f, data, builtin_fragments): |
380 | continue | 402 | continue |