diff options
author | Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com> | 2020-11-17 15:41:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-11-24 10:27:44 +0000 |
commit | 34acb2e340807db7ebe3f1ada7fb1ef4627ff5cf (patch) | |
tree | 31478d370bea95fdf24b5e4baad1e146f24a59cd /meta/classes | |
parent | bfaa03527a24ef338d7087e26c654640202bbde2 (diff) | |
download | poky-34acb2e340807db7ebe3f1ada7fb1ef4627ff5cf.tar.gz |
license_image.bbclass: use canonical name for license files
When copying license files to the image rootfs, i.e to
/usr/share/common-licenses, a canonical name of a license should be
used, otherwise duplicated files end up in common-licenses directory.
For example, GPL-2.0 license according to conf/license.conf can be
referenced in recipes as GPL-2, GPLv2, and GPLv2.0. If a license name is
used directly, we end up with three files in the rootfs with the same
content. If a canonical name used instead, then each license gets copied
only once.
(From OE-Core rev: 670fe71dd18ea675f35581db4a61fda137f8bf00)
Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/license_image.bbclass | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass index 702e9f9c55..119c8dfc86 100644 --- a/meta/classes/license_image.bbclass +++ b/meta/classes/license_image.bbclass | |||
@@ -125,7 +125,6 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
125 | 125 | ||
126 | licenses = os.listdir(pkg_license_dir) | 126 | licenses = os.listdir(pkg_license_dir) |
127 | for lic in licenses: | 127 | for lic in licenses: |
128 | rootfs_license = os.path.join(rootfs_license_dir, lic) | ||
129 | pkg_license = os.path.join(pkg_license_dir, lic) | 128 | pkg_license = os.path.join(pkg_license_dir, lic) |
130 | pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) | 129 | pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) |
131 | 130 | ||
@@ -144,6 +143,8 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
144 | bad_licenses) == False: | 143 | bad_licenses) == False: |
145 | continue | 144 | continue |
146 | 145 | ||
146 | # Make sure we use only canonical name for the license file | ||
147 | rootfs_license = os.path.join(rootfs_license_dir, "generic_%s" % generic_lic) | ||
147 | if not os.path.exists(rootfs_license): | 148 | if not os.path.exists(rootfs_license): |
148 | oe.path.copyhardlink(pkg_license, rootfs_license) | 149 | oe.path.copyhardlink(pkg_license, rootfs_license) |
149 | 150 | ||