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-01 11:31:42 +0100
commit603652a38e7b76fa93090c7eaaf2dc4e8f146f0e (patch)
tree441f759c0225824ee20ac66b26cddf71ae5d46c8 /scripts
parent6958024ed2aa199e56851bf960c06dec1a3d81a1 (diff)
downloadpoky-603652a38e7b76fa93090c7eaaf2dc4e8f146f0e.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: a854d95a79e64f3f82abfa4cc1daec750abf4249) 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>
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)))