aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/license.bbclass
AgeCommit message (Collapse)Author
2013-12-03license.bbclass: include all licenses in the manifestChristopher Larson
When we don't have a generic license file for the license in question, we can warn, but we should still include it in the manifest, otherwise the manifest doesn't reflect reality. Failing to include a license listed in the recipe in the manifest can't be allowed. (From OE-Core master rev: e87232828b761d56f1ce6a27e4009d350d68209c) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03license.bbclass: fix missing of license files on ubuntu build hostChen Qi
The license_create_manifest function contains bashism, this will lead to unexpected results on ubuntu build host, as sh is linked to dash on ubuntu. Even if COPY_LIC_MANIFEST and COPY_LIC_DIRS are enabled, the license files will still be missing on target. This patch fixes the above problem. [YOCTO #5549] (From OE-Core master rev: 4df9daee5c732c0a20dabe8515577238a1508512) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-10classes/license: remove outdated commentPaul Eggleton
Package listing was implemented in the deb backend some time ago. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01license: fix LICENSE_CREATE_PACKAGE to stay disabled by defaultMartin Jansa
* as reported by Enrico on #oe 11:06:50 < ensc|w> JaMa: might this be caused by dc78ef91a2bf01efb8028c9afbe69e506e016265 which checks for 'd.getVar('LICENSE_CREATE_PACKAGE', True)' evaluating to 'True' for every string (including the default 0) (From OE-Core rev: bc42585ad9ca3a9891459ec3234893dff420b95b) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-28license.bbclass: package license texts to PN-lic when LICENSE_CREATE_PACKAGE ↵Martin Jansa
is enabled [YOCTO #3743] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-28license.bbclass: extract functionality to find license files to separate ↵Martin Jansa
function * move it from do_populate_lic to find_license_files so we can reuse it to populate license in package itself [YOCTO #3743] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-18license.bbclass: cleanly handle invalid licenses in incompatible_licenseChristopher Larson
This gives us an error message (bb.fatal) rather than a traceback due to the uncaught LicenseError. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18license: correct re.search/fnmatch indentationChristopher Larson
This was causing it to only obey the last of the elements in INCOMPATIBLE_LICENSE. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18license.bbclass: check LICENSE_pkg, not LICENSE_pn-pkgChristopher Larson
Recipes define the latter, as that's what goes into the binary packages, not the former. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-11base/license.bbclass: handle multiple INCOMPATIBLE_LICENSEsAndy Ross
Allow INCOMPATIBLE_LICENSE to be a whitespace-separated list of incompatible license strings and/or glob patterns. Also fix wildcarding: the string in INCOMPATIBLE_LICENSE was clearly intended to match with wildcards (e.g. "*GPLv3" to match both GPLv3 and LGPLv3), but this was broken because of a bug in return_spdx() which would die with a runtime error when there was no SPDXLICENSEMAP entry for the string. Signed-off-by: Andy Ross <andy.ross@windriver.com> Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-12-07license.bbclass: Including locale packagesElizabeth Flanagan
As locale packages are installed on the image, we should be including them in the package/license manifest. This ensures that the manifests are accurate and complete. [ YOCTO #2461 ] Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06license.bbclass: Avoid grep error messageMark Hatle
Touch a file that is later greped to make sure it exists. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-11-25license.bbclass: Collect LICENSE level packagesFlanagan, Elizabeth
Some bad logic in license.bbclass misses certain package level LICENSEs. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-19license: We need to run this task before do_build, there is no dependency on ↵Richard Purdie
do_package This change means we have more flexibility about when to schedule the license task and if it changes, we don't repackage everything (which is pointless). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-28license.conf/bbclass: Move globals to license.confElizabeth Flanagan
This requires the changes to bitbake.conf that allow parsing of license.conf. As we should now be parsing license.conf, we can move some globals out of license.bblcass and into the conf file. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-28license.bbclass: Variable standardizationElizabeth Flanagan
The variable mentioned in license.conf is LICENSE_PATH. The variable used in license.bbclass is LICENSE_DIR. Conforming to what is in license.conf Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-20Replace "echo -e" with "printf" to have the same behavior in dash or bashAndrei Gherzan
oe-core removed the prerequisite to have sh as bash. POSIX doesn't define any options and furthermore allows 'echo -e' to be the default behavior. This means that in dash 'echo -e' will actually print '-e' and interpret backslashes by default. We use instead 'printf' builtin command with or without '\n' to simulate 'echo -e' or 'echo -n'. 'printf' needs format while 'echo' can be used without any arguments. So 'echo >' was replaced by 'printf "" >'. 'echo' without '-n' flag adds a new line by default so to keep the same behavior of two new lines while using 'echo "\n"', 'printf "\n\n"' is used. [YOCTO #3138] Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-12classes/license: place all found licenses on one lineVladimir Zapolskiy
Cosmetic change, settle all found licenses into one line and report warning about missing licenses loudly. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-12classes/license: correct license info in lisense.manifestVladimir Zapolskiy
Trivial change, do not cut off plus symbol from license name, otherwise information about package license is corrupted. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-12classes/license: account LICENSE_${pkg} values in manifestVladimir Zapolskiy
Trivial change, process LICENSE_${pkg} and LICENSE values. This fixes multiple cases, when license is not specified at all in license.manifest Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-12classes/license: remove redundant nested if statementsVladimir Zapolskiy
Cosmetic change, which improves code perception. Also check for locale packages firstly, this shall improve performance a little. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-12classes/license: check license manifest for double recordsVladimir Zapolskiy
Trivial typo bugfix, avoid multiple records in license.manifest. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-12classes/license: define LICENSE_MANIFEST variableVladimir Zapolskiy
Cosmetic change, saves space and reduces code line length. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-08-17Add MPL version 2.0 license in common-licenses dir as well as adding a ↵Florin Sarbu
non-SPDX license name in license.bbclass Signed-off-by: Florin Sarbu <florin.sarbu@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-26package.bbclass: Create symlinks for packages with different packaged nameAndrei Gherzan
While generating license.manifest package information is searched in: filename=`ls ${TMPDIR}/pkgdata/*/runtime/${pkg}| head -1` This is ok as long as package name is the same as the package name after packaging. For example dbus is packaged as dbus-1. So, searching ls ${TMPDIR}/pkgdata/*/runtime/dbus-1 will fail because there is no file with this package name. Create a symlink to the pkgdata file in a runtime-reverse directory so that these reverse lookups are possible. Fixes [YOCTO #2638]. Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-19Remove a number of unneeded import os/bb callsRichard Purdie
The bb and os modules are always imported so having these extra import calls are a waste of space/execution time. They also set a bad example for people copy and pasting code so clean them up. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19Convert tab indentation in python functions into four-spaceRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09classes/license: fix manifest to work with debPaul Eggleton
Prepend the license manifest creation call to ROOTFS_POSTPROCESS_COMMAND instead of appending to ROOTFS_POSTINSTALL_COMMAND. The latter is not implemented for the deb backend (and probably ought to just be removed completely), and by using _prepend we can still ensure it occurs before package info is removed (and before buildhistory in case it is needed there in future). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-06-05license.bbclass: optimize pkg runtime dataElizabeth Flanagan
This fixes an ugly way I was trying to find pkg runtime data for package and license manifest creation. rootfs generation times for core-image-minimal: Prior to patch real 0m41.570s user 1m40.466s sys 0m6.768s With patch real 0m27.527s user 0m9.833s sys 0m3.496s Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Conflicts: meta/classes/license.bbclass
2012-06-05license.bbclass: Adding PV to package.manifestElizabeth Flanagan
Per request, adding the package version to the package manifest file. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
2012-04-04license.bbclass: Check if copyfile succeeded with isfileAndrei Gherzan
A cleaner way to check if copyfile suceeded is to use os.path.isfile. In this way we can omit warns in some python versions where copyfile return the same non-0 value even is this action is successfull. Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2012-03-29license.bbclass: remove existing license.manifest before appending new dataEric Bénard
without this fix, we append license each time we build again the same image, ending with a large not up to date file. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-25license.bbclass: Style guide complianceElizabeth Flanagan
4 spaces. Correcting some bash whitespace in license to comply with the style guide. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-25INCOMPATIBLE_LICENSE: support for spdx and pkg licensesElizabeth Flanagan
This adds a few things to the incompatible license functionality 1. INCOMPATIBLE_LICENSE was unable to distinguish any variation within LICENSE (e.g. GPLv3 v. GPLv3.0). This now utilizes the SPDXLICENSEMAP of the license indicated as INCOMPATIBLE_LICENSE 2. Given a recipe where the main LICENSE was incompatible but a package of the recipe was compatible, the entire recipe would be excluded. This allows us some finer grained control over what exactly gets excluded. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-25license.bbclass: Whitespace standardizationElizabeth Flanagan
Removing tabs within check_license_flags to standardize to 4 space tabbing Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-25license.bbclass: Add spdx mapping to GPL-1.0Elizabeth Flanagan
Perl is GPL-1.0. For consistency sake, adding an spdx map for GPLv1 Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-22Fix common typoes "existant", "dependant" and variationsRobert P. J. Day
Fix a couple common typoes, all contained within comments so there should be no effect on functionality. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-13license.bbclass: Add mapping for LGPLv2.0, pango uses itRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)Richard Purdie
Using "1" with getVar is bad coding style and "True" is preferred. This patch is a sed over the meta directory of the form: sed \ -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \ -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \ -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24license.bbclass: Symbolic links of generic licenseElizabeth Flanagan
This is to reduce the size of licenses added to images. With this commit license.manifest, original license and generic license adds about .5M to a core-image-minimal image, substantially less than what is currently occuring when COPY_LIC_MANIFEST and COPY_LIC_DIRS are set. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24license.bbclass: Gather Pkg level licensesElizabeth Flanagan
We should look for LICENSE at a package level first. If it's not found, we should use the recipe level LICENSE. This adds a bit more granularity to license manifests where needed. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-24license.bbclass: add support for LICENSE_FLAGSTom Zanussi
LICENSE_FLAGS are a per-recipe replacement for the COMMERCIAL_LICENSE mechanism. In the COMMERCIAL_LICENSE mechanism, any package name mentioned in the global COMMERCIAL_LICENSE list is 'blacklisted' from being included in an image. To allow the blacklisted package into the image, the corresponding packages need to be removed from the COMMERCIAL_LICENSE list. This mechanism relies on a global list defined in default-distrovars.inc. The LICENSE_FLAGS mechanism essentially implements the same thing but turns the global blacklist into a per-recipe whitelist. Any recipe can optionally define one or more 'license flags'; if defined, each of the license flags defined for a recipe must have matching entries in a global LICENSE_FLAGS_WHITELIST variable. The definition of 'matching' is simple, but there are a couple things users need to know in order to correctly and effectively use it. Before we test a flag against the whitelist, we append _${PN} to it, thus automatically making each LICENSE_FLAG recipe-specific. We then try to match that string against the whitelist. So if the user specifies LICENSE_FLAGS = 'commercial' for recipe 'foo', the string 'commercial_foo' should be specified in the whitelist in order for it to match. However, the user can also broaden the match by putting any '_'-separated beginning subset of a LICENSE_FLAG in the whitelist, which will also match e.g. simply specifying 'commercial' in the whitelist would match any expanded LICENSE_FLAG starting with 'commercial' such as 'commercial_foo' and 'commercial_bar' which are the strings that would have been automatically generated if those recipes had simply specified LICENSE_FLAGS = 'commercial' This allows for a range of specificity for the items in the whitelist, from more general to perfectly specific. So users have the choice of exhaustively enumerating each license flag in the whitelist to allow only those specific recipes into the image, or of using a more general string to pick up anything matching just the first component(s). Note that this scheme works even if the flag already has _pn appended - the extra _pn is redundant, but doesn't affect the outcome e.g. a license flag of 'commercial_1.2_foo' would turn into 'commercial_1.2_foo_foo' and would match both the general 'commercial' and the specific 'commercial_1.2_foo' as expected (it would also match commercial_1.2_foo_foo' and 'commercial_1.2', which don't make much sense as far as something a user would think of specifying in the whitelist). For a versioned string, the user could instead specify 'commercial_foo_1.2', which would turn into 'commercial_foo_1.2_foo', but which would as expected allow the user to pick up this package along with anything else 'commercial' by specifying 'commercial' in the whitelist, or anything with a 'commercial_foo' license regardless of version by using 'commercial_foo' in the whitelist, or 'commercial_foo_1.1' to be completely specific about package and version. The current behavior of COMMERCIAL_LICENSE is replicated as mentioned above by having the current set of COMMERCIAL_LICENSE flags implemented using LICENSE_FLAGS = "commercial". That being the case, the current COMMERCIAL_LICENSE can equivalently be specified in the new scheme by putting the below in local.conf: # This is a list of packages that require a commercial license to ship # product. If shipped as part of an image these packages may have # implications so they are disabled by default. To enable them, # un-comment the below as appropriate. #LICENSE_FLAGS_WHITELIST = "commercial_gst-fluendo-mp3 \ # commercial_gst-openmax \ # commercial_gst-plugins-ugly \ # commercial_lame \ # commercial_libmad \ # commercial_libomxil \ # commercial_mpeg2dec \ # commercial_qmmp" The above allows all of the current COMMERCIAL_LICENSE packages in - to disallow a particular package from appearing in the image, simply remove it from the whitelist. To allow them all in, you could also specify LICENSE_FLAGS_WHITELIST = "commercial". Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
2012-01-10license.bbclass base.bbclass: support for 'or' operand in LICENSE and for ↵Andrei Gherzan
SPDX license names A new function was defined in license.bbclass in order to correctly exclude packages where OE-Style licence naming is used. In this way licenses as GPL-3, GPLv3, GPLv3.0 etc will be excluded from a non-GPLv3 build. This function takes into consideration if 'or' operand is used. The function defined in license.bbclass is called in base.bbclass where packages are excluded based on INCOMPATIBLE_LICENSE variable. [YOCTO #1884] [YOCTO #1844] Signed-off-by: Andrei Gherzan <andrei at gherzan.ro> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-21license: Fix manifest conditionalBeth Flanagan
The manifest conditionals COPY_LIC_MANIFEST and COPY_LIC_DIRS were returning true due to missing quotes in the bash test. This made images larger than expected. Signed-off-by: Beth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-16license.bbclass: remove bashismElizabeth Flanagan
Removing a bashism that was dumping errors into rootfs log. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-12license: PR bump failureElizabeth Flanagan
This addtask for do_populate_lic should be reverted back to before do_package as before do_compile causes failures when recipes are updated. [YOCTO #1819] Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
2011-12-10license/copyleft: exception for ast parseElizabeth Flanagan
As the standard for LICENSE format is not well defined, we may well run into issues where LICENSE cannot be parsed via ast. In cases like this, we need to warn and continue. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-10license.bbclass: remove deb exclusionElizabeth Flanagan
This commit requires 4a13766c7b223d as it removes the exclusion of deb package types from license manifest creation. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-10license.bbclass: remove bashism.Elizabeth Flanagan
bashism in create_license_manifest removed. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-08[YOCTO #1776] license: manifest and license pathElizabeth Flanagan
This is a fairly large commit, so I want to step through some of what this accomplishes: 1. Additional licenses I've added/modified/corrected some of the common licenses within OE-core in prep. for a major license audit. Most of these are in SPDX format. A few, there is no OSI equivalent. 2. Additional SPDX mappings I've added some additional SPDX mappings to account for removing some duplicate licenses. (ie GPL-2 and GPL-2.0 were the same) I've also remapped a few things to more accurately reflect what they should be pointing at. Note: Artistic/LGPL/GPL/MPL. Quite a few LICENSE fields list these licenses. They make no sense and need auditing. In a future commit I have some fixes to particularly egregious LICENSE fields, but a full audit should be done. I've listed to obvious candidates at: https://wiki.yoctoproject.org/wiki/License_Audit 3. License manifest We now have a license manifest generation that occurs in rootfs for everything BUT .deb. This requires the changes Paul Eggleton has done to rootfs_* particularly the list_installed_packages function. The manifest is accurate during a parallel bitbake now (Weee!) and is prime for my planned SPDX format manifest during the next period. 4. License manifest on image. We also want the ability to add licenses to the image. This functionality is also in base-files and will be stripped out in my next commit. The manifest is not added by default and is a two var setting in license.conf: If I want *just* the manifest on the image (small) then I set: COPY_LIC_MANIFEST = "1" This copies the manifest to: /usr/share/common-licenses/license.manifest If I want the actual PKG license text on the image (much larger) I need to set both both COPY_LIC_MANIFEST and COPY_LIC_DIRS in license.conf. This will create: /usr/share/common-licenses/(package name)/(licenses in LIC_SRC_URI) Word of warning. This can be larger than wanted depending on image and is probably ripe for linking licenses, but I ran out of time this week to get that done. 5. Custom License search path. We now have the ability to add licenses to the build without touching common-licenses. This is set via license.conf: LICENSE_PATH += "/path/to/custom/licenses" You want to make sure the license is unique. license.bbclass picks the first license it finds. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>