summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Weihmann <kweihmann@outlook.com>2021-12-14 17:39:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-17 09:55:56 +0000
commit8fe68a0516df25a9f336c9f5156a6895d65c0820 (patch)
treeeb67344dbc9c5a0ec72cb5220070c0fa632f46fc
parent05c39d9ee820c5807353d1f147fb36596466d03b (diff)
downloadopenembedded-core-contrib-8fe68a0516df25a9f336c9f5156a6895d65c0820.tar.gz
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. Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/insane.bbclass28
1 files changed, 17 insertions, 11 deletions
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