summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/license.bbclass23
1 files changed, 10 insertions, 13 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 54ab123840..7972c79af5 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -28,6 +28,7 @@ python write_package_manifest() {
28python license_create_manifest() { 28python license_create_manifest() {
29 import re 29 import re
30 import oe.packagedata 30 import oe.packagedata
31 from oe.rootfs import image_list_installed_packages
31 32
32 bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE", True) or "").split() 33 bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE", True) or "").split()
33 bad_licenses = map(lambda l: canonical_license(d, l), bad_licenses) 34 bad_licenses = map(lambda l: canonical_license(d, l), bad_licenses)
@@ -38,19 +39,15 @@ python license_create_manifest() {
38 return 0 39 return 0
39 40
40 pkg_dic = {} 41 pkg_dic = {}
41 package_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY', True), 42 for pkg in image_list_installed_packages(d).split("\n"):
42 d.getVar('IMAGE_NAME', True), 'package.manifest') 43 pkg_info = os.path.join(d.getVar('PKGDATA_DIR', True),
43 with open(package_manifest, "r") as package_file: 44 'runtime-reverse', pkg)
44 pkg_list = package_file.read().split() 45 pkg_name = os.path.basename(os.readlink(pkg_info))
45 for pkg in pkg_list: 46
46 pkg_info = os.path.join(d.getVar('PKGDATA_DIR', True), 47 pkg_dic[pkg_name] = oe.packagedata.read_pkgdatafile(pkg_info)
47 'runtime-reverse', pkg) 48 if not "LICENSE" in pkg_dic[pkg_name].keys():
48 pkg_name = os.path.basename(os.readlink(pkg_info)) 49 pkg_lic_name = "LICENSE_" + pkg_name
49 50 pkg_dic[pkg_name]["LICENSE"] = pkg_dic[pkg_name][pkg_lic_name]
50 pkg_dic[pkg_name] = oe.packagedata.read_pkgdatafile(pkg_info)
51 if not "LICENSE" in pkg_dic[pkg_name].keys():
52 pkg_lic_name = "LICENSE_" + pkg_name
53 pkg_dic[pkg_name]["LICENSE"] = pkg_dic[pkg_name][pkg_lic_name]
54 51
55 license_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY', True), 52 license_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY', True),
56 d.getVar('IMAGE_NAME', True), 'license.manifest') 53 d.getVar('IMAGE_NAME', True), 'license.manifest')