diff options
-rw-r--r-- | scripts/lib/recipetool/create_buildsys_python.py | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py index fb9806d318..354af0cb96 100644 --- a/scripts/lib/recipetool/create_buildsys_python.py +++ b/scripts/lib/recipetool/create_buildsys_python.py | |||
@@ -61,8 +61,6 @@ class PythonRecipeHandler(RecipeHandler): | |||
61 | } | 61 | } |
62 | # PN/PV are already set by recipetool core & desc can be extremely long | 62 | # PN/PV are already set by recipetool core & desc can be extremely long |
63 | excluded_fields = [ | 63 | excluded_fields = [ |
64 | 'Name', | ||
65 | 'Version', | ||
66 | 'Description', | 64 | 'Description', |
67 | ] | 65 | ] |
68 | setup_parse_map = { | 66 | setup_parse_map = { |
@@ -237,7 +235,6 @@ class PythonRecipeHandler(RecipeHandler): | |||
237 | 235 | ||
238 | 236 | ||
239 | # Map PKG-INFO & setup.py fields to bitbake variables | 237 | # Map PKG-INFO & setup.py fields to bitbake variables |
240 | bbinfo = {} | ||
241 | for field, values in info.items(): | 238 | for field, values in info.items(): |
242 | if field in self.excluded_fields: | 239 | if field in self.excluded_fields: |
243 | continue | 240 | continue |
@@ -251,37 +248,8 @@ class PythonRecipeHandler(RecipeHandler): | |||
251 | value = ' '.join(str(v) for v in values if v) | 248 | value = ' '.join(str(v) for v in values if v) |
252 | 249 | ||
253 | bbvar = self.bbvar_map[field] | 250 | bbvar = self.bbvar_map[field] |
254 | if bbvar not in bbinfo and value: | 251 | if bbvar not in extravalues and value: |
255 | bbinfo[bbvar] = value | 252 | extravalues[bbvar] = value |
256 | |||
257 | comment_lic_line = None | ||
258 | for pos, line in enumerate(list(lines_before)): | ||
259 | if line.startswith('#') and 'LICENSE' in line: | ||
260 | comment_lic_line = pos | ||
261 | elif line.startswith('LICENSE =') and 'LICENSE' in bbinfo: | ||
262 | if line in ('LICENSE = "Unknown"', 'LICENSE = "CLOSED"'): | ||
263 | lines_before[pos] = 'LICENSE = "{}"'.format(bbinfo['LICENSE']) | ||
264 | if line == 'LICENSE = "CLOSED"' and comment_lic_line: | ||
265 | lines_before[comment_lic_line:pos] = [ | ||
266 | '# WARNING: the following LICENSE value is a best guess - it is your', | ||
267 | '# responsibility to verify that the value is complete and correct.' | ||
268 | ] | ||
269 | del bbinfo['LICENSE'] | ||
270 | |||
271 | src_uri_line = None | ||
272 | for pos, line in enumerate(lines_before): | ||
273 | if line.startswith('SRC_URI ='): | ||
274 | src_uri_line = pos | ||
275 | |||
276 | if bbinfo: | ||
277 | mdinfo = [''] | ||
278 | for k in sorted(bbinfo): | ||
279 | v = bbinfo[k] | ||
280 | mdinfo.append('{} = "{}"'.format(k, v)) | ||
281 | if src_uri_line: | ||
282 | lines_before[src_uri_line-1:src_uri_line-1] = mdinfo | ||
283 | else: | ||
284 | lines_before.extend(mdinfo) | ||
285 | 253 | ||
286 | mapped_deps, unmapped_deps = self.scan_setup_python_deps(srctree, setup_info, setup_non_literals) | 254 | mapped_deps, unmapped_deps = self.scan_setup_python_deps(srctree, setup_info, setup_non_literals) |
287 | 255 | ||