diff options
| author | Alexander Kanavin <alex.kanavin@gmail.com> | 2023-07-27 16:36:10 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-07-30 09:16:52 +0100 |
| commit | ba961128e2d7d1b4c15daf749ea878efa5cf5da6 (patch) | |
| tree | 468d5e13ed336e6a00bd48754efe202421437546 /meta/classes-global/insane.bbclass | |
| parent | 2c7a4a80215a64934d64c3fe16b139925fed2a86 (diff) | |
| download | poky-ba961128e2d7d1b4c15daf749ea878efa5cf5da6.tar.gz | |
insane.bbclass: add a SUMMARY/HOMEPAGE check (oe-core recipes only)
This was done in a selftest, but that is too late and creates
friction in integration as errors are not seen until autobuilder fails.
Bonus fix: SUMMARY check wasn't even working, as in the absence
of one set in the recipe there is a default value set from bitbake.conf.
I left DESCRIPTION check out for now, as many recipes don't actually
have it, and it's set from SUMMARY (plus a dot) if absent.
(From OE-Core rev: 4144c2f43da39336b03cfd612cbe1694cbf8c7bd)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global/insane.bbclass')
| -rw-r--r-- | meta/classes-global/insane.bbclass | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 148ae4b7ad..78506c30b1 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass | |||
| @@ -50,6 +50,7 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ | |||
| 50 | # Add usrmerge QA check based on distro feature | 50 | # Add usrmerge QA check based on distro feature |
| 51 | ERROR_QA:append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}" | 51 | ERROR_QA:append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}" |
| 52 | ERROR_QA:append:layer-core = " patch-status" | 52 | ERROR_QA:append:layer-core = " patch-status" |
| 53 | WARN_QA:append:layer-core = " missing-metadata" | ||
| 53 | 54 | ||
| 54 | FAKEROOT_QA = "host-user-contaminated" | 55 | FAKEROOT_QA = "host-user-contaminated" |
| 55 | FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \ | 56 | FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \ |
| @@ -1470,6 +1471,21 @@ python do_qa_unpack() { | |||
| 1470 | } | 1471 | } |
| 1471 | 1472 | ||
| 1472 | python do_recipe_qa() { | 1473 | python do_recipe_qa() { |
| 1474 | def test_missing_metadata(d): | ||
| 1475 | fn = d.getVar("FILE") | ||
| 1476 | pn = d.getVar('BPN') | ||
| 1477 | srcfile = d.getVar('SRC_URI').split() | ||
| 1478 | # Check that SUMMARY is not the same as the default from bitbake.conf | ||
| 1479 | if d.getVar('SUMMARY') == d.expand("${PN} version ${PV}-${PR}"): | ||
| 1480 | oe.qa.handle_error("missing-metadata", "Recipe {} in {} does not contain a SUMMARY. Please add an entry.".format(pn, fn), d) | ||
| 1481 | if not d.getVar('HOMEPAGE'): | ||
| 1482 | if srcfile and srcfile[0].startswith('file') or not d.getVar('SRC_URI'): | ||
| 1483 | # We are only interested in recipes SRC_URI fetched from external sources | ||
| 1484 | pass | ||
| 1485 | else: | ||
| 1486 | oe.qa.handle_error("missing-metadata", "Recipe {} in {} does not contain a HOMEPAGE. Please add an entry.".format(pn, fn), d) | ||
| 1487 | |||
| 1488 | test_missing_metadata(d) | ||
| 1473 | oe.qa.exit_if_errors(d) | 1489 | oe.qa.exit_if_errors(d) |
| 1474 | } | 1490 | } |
| 1475 | 1491 | ||
