http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#usingpoky-specifying-LIC_FILES_CHKSUM describes how to select a subset of a file with beginline=5;endline=16 but it does not explain a) whether lines in the file are numbered starting at 0 or 1 b) whether the end line is inclusive or exclusive Each time I add licensing information (which is done rarely) I have to figure it out again by trial and error. I also bet that many recipes which use beginline and endline do not pick the right lines because developers were not careful enough and are off by one in one or both values. The correct answer is: a) lines are numbered starting at 1 b) end line is inclusive A useful trick for the manual therefore would be that for "file://src/ls.c;beginline=5;endline=16", "head -16 ls.c | tail -n +5" gives the license text and "head -15 ls.c | tail -n +5 | md5sum" the checksum.
Surely the easiest way is to set LIC_FILES_CHKSUM to what you want, run it, let it fail and it gives you the correct md5sum value - at least that's what I do.
(In reply to comment #1) > Surely the easiest way is to set LIC_FILES_CHKSUM to what you want, run it, > let it fail and it gives you the correct md5sum value - at least that's what > I do. And if you have picked the wrong lines because the meaning of the numbering wasn't clear? Then you end up storing the correct checksum for the wrong lines in the recipe. In the worst case (like a one-line MIT license remark), you are not even covering the license text at all. This approach is the reason for my bet that there are existing recipes which do not refer to the actual license text. Another useful improvement IMHO would be to include the selected license text in the error message when a license check failed.
Hi, I don't get the useful example. Are you suggesting that this replace the existing last example in the section? Or, is this a whole new paragraph of discussion? I did add a note to explain the line numbering. See http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#usingpoky-specifying-LIC_FILES_CHKSUM Thanks, Scott
I've submitted a patch ("insane.bbclass: print license text as part of QA message") which eliminates the need for developers to extract the right lines manually; if that gets merged, the current change of the documentation is enough.
Hi Patrick, Ok - I will monitor and see if things get merged. If you see or know that it has been merged, you could note it here for me if you like. I would appreciate that :) Thanks, scott
Setting to 2.3 M4. Also to NEEDINFO. I need to know if this has been merged. Scott
This has been merged.
Hi Patrick.. thanks. So, the note I added at http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#usingpoky-specifying-LIC_FILES_CHKSUM describes the line numbering scheme. I am assuming that I probably don't need to put in your example, which I am still not sure on the syntax, since the purpose of your merged patch was to eliminate the need for the user to manually extract the line numbers. However, I did update the single note box to include some additional information about including the failed license text as part of the QA message. Could you review this section and let me know if it is okay? http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#usingpoky-specifying-LIC_FILES_CHKSUM Thanks, Scott
(In reply to comment #8) > However, I did update the single note box to include some additional > information about including the failed license text as part of the QA > message. Could you review this section and let me know if it is okay? For me, the additional explanation ("lines five through 29") is not clear, perhaps because I am not a native speaker, but the "inclusive" word is, so I think we are okay now.
Hi Patrick, Good point if you as a non-native speaker with it not being clear. I have updated the verbiage to be super clear now :) I am going to mark the doc flag off to "Done" now. If you still need some tweaks, just let me know. Thanks, Scott