aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2019-05-17 16:37:43 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-21 12:56:17 +0100
commit21f84fcdd659544437fe393285c407e1e9432043 (patch)
tree98aab738fbc6eda9a6df2e46a2c3f5e88990ec1c /meta/classes/insane.bbclass
parentd1070bcf4358a63c384f2baaddbbf04fe3ac1130 (diff)
downloadopenembedded-core-contrib-21f84fcdd659544437fe393285c407e1e9432043.tar.gz
openembedded-core-contrib-21f84fcdd659544437fe393285c407e1e9432043.tar.bz2
openembedded-core-contrib-21f84fcdd659544437fe393285c407e1e9432043.zip
insane: add sanity checks to SRC_URI
The SRC_URI almost definitely shouldn't be using ${PN}, and GitHub */archive/* tarballs are dynamically generated so the checksums will change over time. Detect both of these, and emit a QA warning if found. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r--meta/classes/insane.bbclass13
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index a9be88e816..fdc20c41a5 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -25,7 +25,7 @@ QA_SANE = "True"
WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
textrel already-stripped incompatible-license files-invalid \
installed-vs-shipped compile-host-path install-host-path \
- pn-overrides infodir build-deps \
+ pn-overrides infodir build-deps src-uri-bad \
unknown-configure-option symlink-to-sysroot multilib \
invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \
"
@@ -892,6 +892,17 @@ 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):
+ package_qa_handle_error("src-uri-bad", "%s: SRC_URI uses PN not BPN" % pn, d)
+
+ pn = d.getVar("SRC_URI")
+ if re.search(r"github\.com/.+/.+/archive/.+", pn):
+ package_qa_handle_error("src-uri-bad", "%s: SRC_URI uses unstable GitHub archives" % pn, d)
+
# The PACKAGE FUNC to scan each package
python do_package_qa () {