summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorThomas Roos <throos@amazon.de>2022-06-28 10:32:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-08 08:27:16 +0100
commit0b047cb6e70ee65bd2b29a81a5ab0fbb5f8c7297 (patch)
tree3e8433787380ff1d48c3307e88ce4542f697f95b /scripts
parentb2dba5ca25a74c5bcc2307c685e9b519fa446afb (diff)
downloadpoky-0b047cb6e70ee65bd2b29a81a5ab0fbb5f8c7297.tar.gz
recipetool/devtool: Fix python egg whitespace issues in PACKAGECONFIG
Substitute expressions or whitespace from python egg requires.txt when generating PACKAGECONFIG Pysetuptools sees the uvicorn.egg-info/requires.txt as extra requirements. Recipetool parses this information to generate the PACKAGECONFIG. These extra requirements contain expressions and whitespace, which are not allowed in PACKGAGECONFIG. This patch substitute them by hyphens to make PACKAGECONFIG parsable and readable. Also adding an oe-selftest for this. [YOCTO #14446] (From OE-Core rev: 5a1fd88439c28c473a1723a040d780f100d6295e) Signed-off-by: Thomas Roos <throos@amazon.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a854d95a79e64f3f82abfa4cc1daec750abf4249) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/recipetool/create_buildsys_python.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py
index f4f51c88b4..5686a62d3f 100644
--- a/scripts/lib/recipetool/create_buildsys_python.py
+++ b/scripts/lib/recipetool/create_buildsys_python.py
@@ -209,6 +209,18 @@ class PythonRecipeHandler(RecipeHandler):
209 continue 209 continue
210 210
211 if line.startswith('['): 211 if line.startswith('['):
212 # PACKAGECONFIG must not contain expressions or whitespace
213 line = line.replace(" ", "")
214 line = line.replace(':', "")
215 line = line.replace('.', "-dot-")
216 line = line.replace('"', "")
217 line = line.replace('<', "-smaller-")
218 line = line.replace('>', "-bigger-")
219 line = line.replace('_', "-")
220 line = line.replace('(', "")
221 line = line.replace(')', "")
222 line = line.replace('!', "-not-")
223 line = line.replace('=', "-equals-")
212 current_feature = line[1:-1] 224 current_feature = line[1:-1]
213 elif current_feature: 225 elif current_feature:
214 extras_req[current_feature].append(line) 226 extras_req[current_feature].append(line)
@@ -297,6 +309,7 @@ class PythonRecipeHandler(RecipeHandler):
297 lines_after.append('# The following configs & dependencies are from setuptools extras_require.') 309 lines_after.append('# The following configs & dependencies are from setuptools extras_require.')
298 lines_after.append('# These dependencies are optional, hence can be controlled via PACKAGECONFIG.') 310 lines_after.append('# These dependencies are optional, hence can be controlled via PACKAGECONFIG.')
299 lines_after.append('# The upstream names may not correspond exactly to bitbake package names.') 311 lines_after.append('# The upstream names may not correspond exactly to bitbake package names.')
312 lines_after.append('# The configs are might not correct, since PACKAGECONFIG does not support expressions as may used in requires.txt - they are just replaced by text.')
300 lines_after.append('#') 313 lines_after.append('#')
301 lines_after.append('# Uncomment this line to enable all the optional features.') 314 lines_after.append('# Uncomment this line to enable all the optional features.')
302 lines_after.append('#PACKAGECONFIG ?= "{}"'.format(' '.join(k.lower() for k in extras_req))) 315 lines_after.append('#PACKAGECONFIG ?= "{}"'.format(' '.join(k.lower() for k in extras_req)))