Skip to contentSkip to conversation

insane.bbclass: Warn if ${COREBASE}/LICENSE is used

PATCH RESEND Superseded Saul Wold 5 participants 5 messages Aug 31, 2017 – Sep 1, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

PATCH RESEND 1/1 insane.bbclass: Warn if ${COREBASE}/LICENSE is used

The top level LICENSE file is not actually a license, it refers other licenses that are used by Bitbake and Meta-data. Relying on this file could cause problems for recipes when this file changes, which it is about to.

---
 meta/classes/insane.bbclass | 6 +++++-

 1 file changed, 5 insertions(+), 1 deletion(-)
meta/classes/insane.bbclass +0 -0
index 479d39c..6d20eb6 100644
@@ -659,7 +659,7 @@ python populate_lic_qa_checksum() {

         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" for url in lic_files.split():
         try:
             (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
@@ -670,6 +670,10 @@ python populate_lic_qa_checksum() {
         if not os.path.isfile(srclicfile):
             package_qa_handle_error("license-checksum", pn + ":
LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d) continue
+
+        if (srclicfile == corebase_licensefile):
+            bb.warn("${COREBASE}/LICENSE is not a valid license file, please use '${COMMON_LICENSE_DIR}/MIT' for a MIT License file in LIC_FILES_CHKSUM")
+            bb.warn("This will become an error in the next release")
         recipemd5 = parm.get('md5', '')
         beginline, endline = 0, 0
--
2.7.5

#1 lore raw

✗ patchtest: failure for insane.bbclass: Warn if ${COREBASE}/LICENSE is used (rev2)

== Series Details ==

Series: insane.bbclass: Warn if ${COREBASE}/LICENSE is used (rev2)
Revision: 2
URL : https://patchwork.openembedded.org/series/8319/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Series cannot be parsed correctly due to malformed diff lines [test_mbox_format]
Suggested fix Create the series again using git-format-patch and ensure it can be applied using git am
Diff line @@ -670,6 +670,10 @@ python populate_lic_qa_checksum() {

* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at 811edd9542)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
#2 lore raw
In reply to Saul Wold

This and the other patch have been wrapped by your mailer, and also base64 encoded so I can't trivially fix the whitespace. Are they in a branch, or can you resend them using git-send-email?

Ross

Quoted 49 lines · Saul Wold

The top level LICENSE file is not actually a license, it refers other licenses that are used by Bitbake and Meta-data. Relying on this file could cause problems for recipes when this file changes, which it is about to.

---
 meta/classes/insane.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/classes/insane.bbclass +0 -0
index 479d39c..6d20eb6 100644
@@ -659,7 +659,7 @@ python populate_lic_qa_checksum() {
         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')
meta/classes/insane.bbclass +1 -1
-
+    corebase_licensefile = d.getVar('COREBASE') + "/LICENSE"
     for url in lic_files.split():
         try:
             (type, host, path, user, pswd, parm) =

bb.fetch.decodeurl(url)

meta/classes/insane.bbclass +3 -0
@@ -670,6 +670,10 @@ python populate_lic_qa_checksum() {
         if not os.path.isfile(srclicfile):
             package_qa_handle_error("license-checksum", pn + ":
 LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
             continue
+
+        if (srclicfile == corebase_licensefile):
+            bb.warn("${COREBASE}/LICENSE is not a valid license file,

please use '${COMMON_LICENSE_DIR}/MIT' for a MIT License file in LIC_FILES_CHKSUM")
+ bb.warn("This will become an error in the next release")

recipemd5 = parm.get('md5', '')
beginline, endline = 0, 0
--
2.7.5

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 3 lines · Ross

This and the other patch have been wrapped by your mailer, and also base64 encoded so I can't trivially fix the whitespace.  Are they in a branch, or can you resend them using git-send-email?

I found them on a branch and applied it in -next.

Cheers,

Richard

#4 lore raw
In reply to Saul Wold

Hi Saul

Quoted 34 lines · NZST Saul Wold

The top level LICENSE file is not actually a license, it refers other licenses that are used by Bitbake and Meta-data. Relying on this file could cause problems for recipes when this file changes, which it is about to.

---
 meta/classes/insane.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/classes/insane.bbclass +0 -0
index 479d39c..6d20eb6 100644
@@ -659,7 +659,7 @@ python populate_lic_qa_checksum() {
         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')
meta/classes/insane.bbclass +1 -1
-
+    corebase_licensefile = d.getVar('COREBASE') + "/LICENSE"
     for url in lic_files.split():
         try:
             (type, host, path, user, pswd, parm) =

bb.fetch.decodeurl(url)

meta/classes/insane.bbclass +3 -0
@@ -670,6 +670,10 @@ python populate_lic_qa_checksum() {
         if not os.path.isfile(srclicfile):
             package_qa_handle_error("license-checksum", pn + ":
 LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
             continue
+        
+        if (srclicfile == corebase_licensefile):
+            bb.warn("${COREBASE}/LICENSE is not a valid license file,
Quoted 3 lines

please use '${COMMON_LICENSE_DIR}/MIT' for a MIT License file in LIC_FILES_CHKSUM")
+ bb.warn("This will become an error in the next release")

Can this be one bb.warn() call? Otherwise it's considered to be two warnings by the UI. Also, it's rare for us to even make such a comment in a warning, but I think we would say "in future" rather than "in the next release".

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre