The license directory and license.manifest does not exclude licenses matching those specified INCOMPATIBLE_LICENSE.
Jonathan, can you explain what you're looking for here, and perhaps give an example of where the current code is behaving incorrectly? I'm cautious about the idea of filtering out any licenses at this point in case incompatibly-licensed packages somehow haven't already been filtered out at an earlier stage.
The qt4 recipe for example has LICENSE set to "LGPLv2.1 | GPLv3". Now, if you don't want any GPLv3 licensing you add GPLv3 to INCOMPATIBLE_LICENSE. The license directory and license manifest should only include the LGPLv2.1 license for this recipe to indicate that you have selected the LGPLv2.1 license instead. A recipe may also have different groups of licenses separated by | operators so it should probably filter out the groups of licenses that INCOMPATIBLE_LICENSE would match.
OK, so the filtering would need to be done in such a way that it understood the expression. Coincidentally Chris Larson brought up this situation on IRC just yesterday (adding him to CC).
Jonathan, For example in the qt4 recipe that have LICENSE set to "LGPLv2.1 | GPLv3" if you don't have INCOMPATIBLE_LICENSE set what is expected? license.manifest with LICENSE set LGPLv2.1 | GPLv3 and copy the two licenses?
Yes.
Jhonatan, I'm reviewing the oe.license module it have a function named flattened_licenses that is used in early recipe parsing phase. Eval's OR's with your own choose function but for example if you have LICENSE set (GPLv2 | GPLv3 | MPL) & LGPLv2.1 and INCOMPATIBLE_LICENSE set to GPLv3 the result is the next GPLv2 & LGPLv2.1. That's is the expected behaviour?
https://gist.github.com/kergoth/1590028 isn't directly related, but it's a mechanism to let a distro specify their preferences for which licenses they prefer when there are alternatives. The intent was to take it and use it for incompatible license handling, packaging, manifest, etc.
Created attachment 2160 [details] Added support for handle OR's and INCOMPATIBLE_LICENSE
I re-implemented license_create_manifest from shell to python in order to use oe.license module. This implementation didn't take into account LICENSE_PRIORITY only INCOMPATIBLE_LICENSE. One issue that i found is if you have different licenses grouped by OR only one of them is applied, for example (GPLv2 | GPLv3 | MPL) this result into GPLv2, regardless of the INCOMPATIBLE_LICENSE, that's ok? I think we can use the Christopher code for handle priorities but this is another feature. Comments?
Created attachment 2161 [details] License Manifest Python
Agreed, it was more an example. It is a bit of a concern that only one of the 3 alternates is selected, mainly because lacking the priority mechanism, its arbitrary and undefined which of the other two alternates is selected.
Created attachment 2162 [details] License Manifest Shell
Created attachment 2163 [details] License Manifest Diff
Created attachment 2164 [details] Local Conf
Christopher, Sure for now the first LICENSE have major weight if not is in INCOMPATIBLE_LICENSE.
Created attachment 2443 [details] License Manifest Test Results
Rebase needed.
http://lists.openembedded.org/pipermail/openembedded-core/2015-May/104559.html
Merged at, http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b394cd4c7e1997f3df4a0c796446b48dd7fe2c07