summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
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:56:14 +0000
commit53a41cb39c9273f3ebf032cc7756c7653e6aa033 (patch)
tree7aaf4f8f33799f22f8073d150504ade7dbc2dd3e /meta/classes/insane.bbclass
parent35ca84e101b1f0cf55dc895243ee321d5102326e (diff)
downloadpoky-53a41cb39c9273f3ebf032cc7756c7653e6aa033.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. (From OE-Core rev: 8fe68a0516df25a9f336c9f5156a6895d65c0820) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-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):
968 return False 968 return False
969 return True 969 return True
970 970
971QARECIPETEST[src-uri-bad] = "package_qa_check_src_uri"
972def package_qa_check_src_uri(pn, d, messages):
973 import re
974
975 if "${PN}" in d.getVar("SRC_URI", False):
976 oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses PN not BPN" % pn, d)
977
978 for url in d.getVar("SRC_URI").split():
979 if re.search(r"git(hu|la)b\.com/.+/.+/archive/.+", url):
980 oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses unstable GitHub/GitLab archives, convert recipe to use git protocol" % pn, d)
981
982QARECIPETEST[unhandled-features-check] = "package_qa_check_unhandled_features_check" 971QARECIPETEST[unhandled-features-check] = "package_qa_check_unhandled_features_check"
983def package_qa_check_unhandled_features_check(pn, d, messages): 972def package_qa_check_unhandled_features_check(pn, d, messages):
984 if not bb.data.inherits_class('features_check', d): 973 if not bb.data.inherits_class('features_check', d):
@@ -1285,11 +1274,28 @@ Rerun configure task after fixing this."""
1285 oe.qa.exit_if_errors(d) 1274 oe.qa.exit_if_errors(d)
1286} 1275}
1287 1276
1277def unpack_check_src_uri(pn, d):
1278 import re
1279
1280 skip = (d.getVar('INSANE_SKIP') or "").split()
1281 if 'src-uri-bad' in skip:
1282 bb.note("Recipe %s skipping qa checking: src-uri-bad" % d.getVar('PN'))
1283 return
1284
1285 if "${PN}" in d.getVar("SRC_URI", False):
1286 oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses PN not BPN" % pn, d)
1287
1288 for url in d.getVar("SRC_URI").split():
1289 if re.search(r"git(hu|la)b\.com/.+/.+/archive/.+", url):
1290 oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses unstable GitHub/GitLab archives, convert recipe to use git protocol" % pn, d)
1291
1288python do_qa_unpack() { 1292python do_qa_unpack() {
1289 src_uri = d.getVar('SRC_URI') 1293 src_uri = d.getVar('SRC_URI')
1290 s_dir = d.getVar('S') 1294 s_dir = d.getVar('S')
1291 if src_uri and not os.path.exists(s_dir): 1295 if src_uri and not os.path.exists(s_dir):
1292 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)) 1296 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))
1297
1298 unpack_check_src_uri(d.getVar('PN'), d)
1293} 1299}
1294 1300
1295# The Staging Func, to check all staging 1301# The Staging Func, to check all staging