summaryrefslogtreecommitdiffstats
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:33 +0100
commitbef89e6a8bc7a83ef9e1ccca2fa86a6fca376749 (patch)
treea1061934d23a8272c921d46f81e401cf52285b8f /meta/classes/insane.bbclass
parent609f77ae3b163322b23ccc5fd4ed617e068d4675 (diff)
downloadpoky-bef89e6a8bc7a83ef9e1ccca2fa86a6fca376749.tar.gz
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. (From OE-Core rev: 21f84fcdd659544437fe393285c407e1e9432043) 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"
25WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \ 25WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
26 textrel already-stripped incompatible-license files-invalid \ 26 textrel already-stripped incompatible-license files-invalid \
27 installed-vs-shipped compile-host-path install-host-path \ 27 installed-vs-shipped compile-host-path install-host-path \
28 pn-overrides infodir build-deps \ 28 pn-overrides infodir build-deps src-uri-bad \
29 unknown-configure-option symlink-to-sysroot multilib \ 29 unknown-configure-option symlink-to-sysroot multilib \
30 invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ 30 invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \
31 " 31 "
@@ -892,6 +892,17 @@ def package_qa_check_host_user(path, name, d, elf, messages):
892 return False 892 return False
893 return True 893 return True
894 894
895QARECIPETEST[src-uri-bad] = "package_qa_check_src_uri"
896def package_qa_check_src_uri(pn, d, messages):
897 import re
898
899 if "${PN}" in d.getVar("SRC_URI", False):
900 package_qa_handle_error("src-uri-bad", "%s: SRC_URI uses PN not BPN" % pn, d)
901
902 pn = d.getVar("SRC_URI")
903 if re.search(r"github\.com/.+/.+/archive/.+", pn):
904 package_qa_handle_error("src-uri-bad", "%s: SRC_URI uses unstable GitHub archives" % pn, d)
905
895 906
896# The PACKAGE FUNC to scan each package 907# The PACKAGE FUNC to scan each package
897python do_package_qa () { 908python do_package_qa () {