summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-29 14:23:14 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-30 23:04:18 +0100
commitbae779411213b73376b2d713683e3392829acef9 (patch)
tree38d9441a64def5081724c560da863ccd1663f94b /meta/classes/package.bbclass
parent24609d9b60f1c64b78c9989b0c6644f3c2895da0 (diff)
downloadpoky-bae779411213b73376b2d713683e3392829acef9.tar.gz
package: Fix license exclusion packaging errors
Currently the license exclusion code removes packages from PACKAGES pre population of the package directories. This means that the FILES entries for some packages are not seen and invariably results in packaging errors. Instead, remove the packages from PACKAGES post population of the packages so the usual FILES entries work as expected but the file are not placed into any packages and no packages containing embargoed licenses are generated. This avoids errors from gcc-runtime with GPLv3 exclusion like: ERROR: QA Issue: gcc-runtime: Files/directories were installed but not shipped in any package: /usr/share /usr/src /usr/share/gcc-4.9.2 /usr/share/gcc-4.9.2/python Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install. [installed-vs-shipped] (From OE-Core rev: 09c3d648c95fe88197c15d656bda1c9303aa2079) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass18
1 files changed, 11 insertions, 7 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 5ece69e0c5..a76e6e9b36 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1041,14 +1041,11 @@ python populate_packages () {
1041 bb.utils.mkdirhier(outdir) 1041 bb.utils.mkdirhier(outdir)
1042 os.chdir(dvar) 1042 os.chdir(dvar)
1043 1043
1044 # Sanity check PACKAGES for duplicates and for LICENSE_EXCLUSION 1044 # Sanity check PACKAGES for duplicates
1045 # Sanity should be moved to sanity.bbclass once we have the infrastucture 1045 # Sanity should be moved to sanity.bbclass once we have the infrastucture
1046 package_list = [] 1046 package_list = []
1047 1047
1048 for pkg in packages.split(): 1048 for pkg in packages.split():
1049 if d.getVar('LICENSE_EXCLUSION-' + pkg, True):
1050 msg = "%s has an incompatible license. Excluding from packaging." % pkg
1051 package_qa_handle_error("incompatible-license", msg, d)
1052 if pkg in package_list: 1049 if pkg in package_list:
1053 msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg 1050 msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg
1054 package_qa_handle_error("packages-list", msg, d) 1051 package_qa_handle_error("packages-list", msg, d)
@@ -1082,9 +1079,6 @@ python populate_packages () {
1082 continue 1079 continue
1083 seen.append(file) 1080 seen.append(file)
1084 1081
1085 if d.getVar('LICENSE_EXCLUSION-' + pkg, True):
1086 continue
1087
1088 def mkdir(src, dest, p): 1082 def mkdir(src, dest, p):
1089 src = os.path.join(src, p) 1083 src = os.path.join(src, p)
1090 dest = os.path.join(dest, p) 1084 dest = os.path.join(dest, p)
@@ -1125,6 +1119,16 @@ python populate_packages () {
1125 os.umask(oldumask) 1119 os.umask(oldumask)
1126 os.chdir(workdir) 1120 os.chdir(workdir)
1127 1121
1122 # Handle LICENSE_EXCLUSION
1123 package_list = []
1124 for pkg in packages.split():
1125 if d.getVar('LICENSE_EXCLUSION-' + pkg, True):
1126 msg = "%s has an incompatible license. Excluding from packaging." % pkg
1127 package_qa_handle_error("incompatible-license", msg, d)
1128 else:
1129 package_list.append(pkg)
1130 d.setVar('PACKAGES', ' '.join(package_list))
1131
1128 unshipped = [] 1132 unshipped = []
1129 for root, dirs, files in cpath.walk(dvar): 1133 for root, dirs, files in cpath.walk(dvar):
1130 dir = root[len(dvar):] 1134 dir = root[len(dvar):]