* [PATCH 1/2] insane.bbclass: Make missing license file fatal
@ 2018-06-25 11:34 Olof Johansson
2018-06-25 11:34 ` [PATCH 2/2] insane.bbclass: Don't let warnings make previous errors non-fatal Olof Johansson
0 siblings, 1 reply; 2+ messages in thread
From: Olof Johansson @ 2018-06-25 11:34 UTC (permalink / raw)
To: openembedded-core; +Cc: Olof Johansson
If a license file referenced from LIC_FILES_CHKSUM doesn't exist,
insane.bbclass would output an error message, but would continue the
build. This change makes this error fatal (as I suspect has been the
intention).
Signed-off-by: Olof Johansson <olofjn@axis.com>
---
meta/classes/insane.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index bd7f51956a6..bdfdc315aae 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -612,7 +612,7 @@ python populate_lic_qa_checksum() {
continue
srclicfile = os.path.join(srcdir, path)
if not os.path.isfile(srclicfile):
- package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
+ sane = package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
continue
if (srclicfile == corebase_licensefile):
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] insane.bbclass: Don't let warnings make previous errors non-fatal
2018-06-25 11:34 [PATCH 1/2] insane.bbclass: Make missing license file fatal Olof Johansson
@ 2018-06-25 11:34 ` Olof Johansson
0 siblings, 0 replies; 2+ messages in thread
From: Olof Johansson @ 2018-06-25 11:34 UTC (permalink / raw)
To: openembedded-core; +Cc: Olof Johansson
package_qa_handle_error() returns True on non-fatal issues and False on
fatal issues. But the current usage has been to do
sane = package_qa_handle_error(...)
which would always reset sanity status to be that of the last issue
identified. This change the assignments to use the &= operator instead:
sane &= package_qa_handle_error(...)
As far as I can tell, this is not a real problem in practice, because
warnings of different levels (WARN_QA, ERROR_QA) does not seem to have
been mixed in a way that triggered this issue.
Signed-off-by: Olof Johansson <olofjn@axis.com>
---
meta/classes/insane.bbclass | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index bdfdc315aae..713b40eac42 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -600,7 +600,7 @@ python populate_lic_qa_checksum() {
return
if not lic_files and d.getVar('SRC_URI'):
- sane = package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d)
+ sane &= package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d)
srcdir = d.getVar('S')
corebase_licensefile = d.getVar('COREBASE') + "/LICENSE"
@@ -608,11 +608,11 @@ python populate_lic_qa_checksum() {
try:
(type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
except bb.fetch.MalformedUrl:
- sane = package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d)
+ sane &= package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d)
continue
srclicfile = os.path.join(srcdir, path)
if not os.path.isfile(srclicfile):
- sane = package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
+ sane &= package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
continue
if (srclicfile == corebase_licensefile):
@@ -696,7 +696,7 @@ python populate_lic_qa_checksum() {
else:
msg = pn + ": LIC_FILES_CHKSUM is not specified for " + url
msg = msg + "\n" + pn + ": The md5 checksum is " + md5chksum
- sane = package_qa_handle_error("license-checksum", msg, d)
+ sane &= package_qa_handle_error("license-checksum", msg, d)
if not sane:
bb.fatal("Fatal QA errors found, failing task.")
@@ -733,14 +733,14 @@ def package_qa_check_staged(path,d):
file_content = file_content.replace(recipesysroot, "")
if workdir in file_content:
error_msg = "%s failed sanity test (workdir) in path %s" % (file,root)
- sane = package_qa_handle_error("la", error_msg, d)
+ sane &= package_qa_handle_error("la", error_msg, d)
elif file.endswith(".pc"):
with open(path) as f:
file_content = f.read()
file_content = file_content.replace(recipesysroot, "")
if pkgconfigcheck in file_content:
error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root)
- sane = package_qa_handle_error("pkgconfig", error_msg, d)
+ sane &= package_qa_handle_error("pkgconfig", error_msg, d)
return sane
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-25 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-25 11:34 [PATCH 1/2] insane.bbclass: Make missing license file fatal Olof Johansson
2018-06-25 11:34 ` [PATCH 2/2] insane.bbclass: Don't let warnings make previous errors non-fatal Olof Johansson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.