diff options
author | Kai Kang <kai.kang@windriver.com> | 2019-12-10 17:35:34 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-12 12:46:08 +0000 |
commit | 48f7290a8e4a7cbee5d1571ac712fe81c18b1d4b (patch) | |
tree | d63b45892da41d753c01d0608479e83c2fe07221 /meta/classes/base.bbclass | |
parent | 3c0a53fe75f304267b6407d5e62101daba498c0e (diff) | |
download | poky-48f7290a8e4a7cbee5d1571ac712fe81c18b1d4b.tar.gz |
base.bbclass: extend PACKAGECONFIG for conflict package configs
There are mutually exclusive PACKAGECONFIGs in recipes. Though it
declares that package configs are exclusive, it can't prevent users to
set them at same time. Extend PACKAGECONFIG to support specifying
conflicted package configs.
(From OE-Core rev: 734475b3f86d88a548bc9eb91d836bd1b9335e9f)
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r-- | meta/classes/base.bbclass | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 7bfb1d1912..45f9435fd8 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -393,7 +393,7 @@ python () { | |||
393 | # These take the form: | 393 | # These take the form: |
394 | # | 394 | # |
395 | # PACKAGECONFIG ??= "<default options>" | 395 | # PACKAGECONFIG ??= "<default options>" |
396 | # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends,foo_runtime_recommends" | 396 | # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends,foo_runtime_recommends,foo_conflict_packageconfig" |
397 | pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {} | 397 | pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {} |
398 | if pkgconfigflags: | 398 | if pkgconfigflags: |
399 | pkgconfig = (d.getVar('PACKAGECONFIG') or "").split() | 399 | pkgconfig = (d.getVar('PACKAGECONFIG') or "").split() |
@@ -440,8 +440,8 @@ python () { | |||
440 | for flag, flagval in sorted(pkgconfigflags.items()): | 440 | for flag, flagval in sorted(pkgconfigflags.items()): |
441 | items = flagval.split(",") | 441 | items = flagval.split(",") |
442 | num = len(items) | 442 | num = len(items) |
443 | if num > 5: | 443 | if num > 6: |
444 | bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend,rrecommend can be specified!" | 444 | bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend,rrecommend,conflict_packageconfig can be specified!" |
445 | % (d.getVar('PN'), flag)) | 445 | % (d.getVar('PN'), flag)) |
446 | 446 | ||
447 | if flag in pkgconfig: | 447 | if flag in pkgconfig: |
@@ -455,6 +455,20 @@ python () { | |||
455 | extraconf.append(items[0]) | 455 | extraconf.append(items[0]) |
456 | elif num >= 2 and items[1]: | 456 | elif num >= 2 and items[1]: |
457 | extraconf.append(items[1]) | 457 | extraconf.append(items[1]) |
458 | |||
459 | if num >= 6 and items[5]: | ||
460 | conflicts = set(items[5].split()) | ||
461 | invalid = conflicts.difference(set(pkgconfigflags.keys())) | ||
462 | if invalid: | ||
463 | bb.error("%s: PACKAGECONFIG[%s] Invalid conflict package config%s '%s' specified." | ||
464 | % (d.getVar('PN'), flag, 's' if len(invalid) > 1 else '', ' '.join(invalid))) | ||
465 | |||
466 | if flag in pkgconfig: | ||
467 | intersec = conflicts.intersection(set(pkgconfig)) | ||
468 | if intersec: | ||
469 | bb.fatal("%s: PACKAGECONFIG[%s] Conflict package config%s '%s' set in PACKAGECONFIG." | ||
470 | % (d.getVar('PN'), flag, 's' if len(intersec) > 1 else '', ' '.join(intersec))) | ||
471 | |||
458 | appendVar('DEPENDS', extradeps) | 472 | appendVar('DEPENDS', extradeps) |
459 | appendVar('RDEPENDS_${PN}', extrardeps) | 473 | appendVar('RDEPENDS_${PN}', extrardeps) |
460 | appendVar('RRECOMMENDS_${PN}', extrarrecs) | 474 | appendVar('RRECOMMENDS_${PN}', extrarrecs) |