From 53a41cb39c9273f3ebf032cc7756c7653e6aa033 Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Tue, 14 Dec 2021 17:39:20 +0100 Subject: insane: move src-uri-bad checks to unpack stage previously used package_qa_check_src_uri was triggered during package_qa stage, which implies having packages. This isn't the case for native-only recipes or recipe that inherit nopackages. Still the checks performed (src-uri-bad) apply to those as well. Therefore move the check from package_qa stage to unpack stage. (From OE-Core rev: 8fe68a0516df25a9f336c9f5156a6895d65c0820) Signed-off-by: Konrad Weihmann Signed-off-by: Richard Purdie --- meta/classes/insane.bbclass | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'meta') diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index d33918c7ce..11532ecd08 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -968,17 +968,6 @@ def package_qa_check_host_user(path, name, d, elf, messages): return False return True -QARECIPETEST[src-uri-bad] = "package_qa_check_src_uri" -def package_qa_check_src_uri(pn, d, messages): - import re - - if "${PN}" in d.getVar("SRC_URI", False): - oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses PN not BPN" % pn, d) - - for url in d.getVar("SRC_URI").split(): - if re.search(r"git(hu|la)b\.com/.+/.+/archive/.+", url): - oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses unstable GitHub/GitLab archives, convert recipe to use git protocol" % pn, d) - QARECIPETEST[unhandled-features-check] = "package_qa_check_unhandled_features_check" def package_qa_check_unhandled_features_check(pn, d, messages): if not bb.data.inherits_class('features_check', d): @@ -1285,11 +1274,28 @@ Rerun configure task after fixing this.""" oe.qa.exit_if_errors(d) } +def unpack_check_src_uri(pn, d): + import re + + skip = (d.getVar('INSANE_SKIP') or "").split() + if 'src-uri-bad' in skip: + bb.note("Recipe %s skipping qa checking: src-uri-bad" % d.getVar('PN')) + return + + if "${PN}" in d.getVar("SRC_URI", False): + oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses PN not BPN" % pn, d) + + for url in d.getVar("SRC_URI").split(): + if re.search(r"git(hu|la)b\.com/.+/.+/archive/.+", url): + oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses unstable GitHub/GitLab archives, convert recipe to use git protocol" % pn, d) + python do_qa_unpack() { src_uri = d.getVar('SRC_URI') s_dir = d.getVar('S') if src_uri and not os.path.exists(s_dir): bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN'), d.getVar('S', False), s_dir)) + + unpack_check_src_uri(d.getVar('PN'), d) } # The Staging Func, to check all staging -- cgit v1.2.3-54-g00ecf