diff options
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r-- | meta/classes/license.bbclass | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index dc91118340..806b5069fd 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass | |||
@@ -31,8 +31,8 @@ python do_populate_lic() { | |||
31 | f.write("%s: %s\n" % (key, info[key])) | 31 | f.write("%s: %s\n" % (key, info[key])) |
32 | } | 32 | } |
33 | 33 | ||
34 | PSEUDO_IGNORE_PATHS .= ",${@','.join(((d.getVar('COMMON_LICENSE_DIR') or '') + ' ' + (d.getVar('LICENSE_PATH') or '')).split())}" | 34 | PSEUDO_IGNORE_PATHS .= ",${@','.join(((d.getVar('COMMON_LICENSE_DIR') or '') + ' ' + (d.getVar('LICENSE_PATH') or '') + ' ' + d.getVar('COREBASE') + '/meta/COPYING').split())}" |
35 | # it would be better to copy them in do_install_append, but find_license_filesa is python | 35 | # it would be better to copy them in do_install:append, but find_license_filesa is python |
36 | python perform_packagecopy_prepend () { | 36 | python perform_packagecopy_prepend () { |
37 | enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d) | 37 | enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d) |
38 | if d.getVar('CLASSOVERRIDE') == 'class-target' and enabled: | 38 | if d.getVar('CLASSOVERRIDE') == 'class-target' and enabled: |
@@ -91,17 +91,17 @@ def copy_license_files(lic_files_paths, destdir): | |||
91 | os.link(src, dst) | 91 | os.link(src, dst) |
92 | except OSError as err: | 92 | except OSError as err: |
93 | if err.errno == errno.EXDEV: | 93 | if err.errno == errno.EXDEV: |
94 | # Copy license files if hard-link is not possible even if st_dev is the | 94 | # Copy license files if hardlink is not possible even if st_dev is the |
95 | # same on source and destination (docker container with device-mapper?) | 95 | # same on source and destination (docker container with device-mapper?) |
96 | canlink = False | 96 | canlink = False |
97 | else: | 97 | else: |
98 | raise | 98 | raise |
99 | # Only chown if we did hardling, and, we're running under pseudo | 99 | # Only chown if we did hardlink and we're running under pseudo |
100 | if canlink and os.environ.get('PSEUDO_DISABLED') == '0': | 100 | if canlink and os.environ.get('PSEUDO_DISABLED') == '0': |
101 | os.chown(dst,0,0) | 101 | os.chown(dst,0,0) |
102 | if not canlink: | 102 | if not canlink: |
103 | begin_idx = int(beginline)-1 if beginline is not None else None | 103 | begin_idx = max(0, int(beginline) - 1) if beginline is not None else None |
104 | end_idx = int(endline) if endline is not None else None | 104 | end_idx = max(0, int(endline)) if endline is not None else None |
105 | if begin_idx is None and end_idx is None: | 105 | if begin_idx is None and end_idx is None: |
106 | shutil.copyfile(src, dst) | 106 | shutil.copyfile(src, dst) |
107 | else: | 107 | else: |
@@ -153,6 +153,10 @@ def find_license_files(d): | |||
153 | find_license(node.s.replace("+", "").replace("*", "")) | 153 | find_license(node.s.replace("+", "").replace("*", "")) |
154 | self.generic_visit(node) | 154 | self.generic_visit(node) |
155 | 155 | ||
156 | def visit_Constant(self, node): | ||
157 | find_license(node.value.replace("+", "").replace("*", "")) | ||
158 | self.generic_visit(node) | ||
159 | |||
156 | def find_license(license_type): | 160 | def find_license(license_type): |
157 | try: | 161 | try: |
158 | bb.utils.mkdirhier(gen_lic_dest) | 162 | bb.utils.mkdirhier(gen_lic_dest) |