diff options
author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2024-02-10 14:15:54 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-13 13:51:41 +0000 |
commit | 605ef6f5a292fe169b1469b0a8996f3d5ae53daf (patch) | |
tree | 68ea616c466ade988cc324256d012e1ec6501942 /scripts/lib/recipetool/create_buildsys.py | |
parent | 97eebe59d7ba9d7eb647a2f2a0353fc2424e9827 (diff) | |
download | poky-605ef6f5a292fe169b1469b0a8996f3d5ae53daf.tar.gz |
scripts: python 3.12 regex
All the regexes throw a warning like this:
WARNING: scripts/lib/recipetool/create_buildsys.py:140:
SyntaxWarning: invalid escape sequence '\s'
proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE)
Python 3 interprets string literals as Unicode strings, and therefore
\s is treated as an escaped Unicode character which is not correct.
Declaring the RegEx pattern as a raw string instead of unicode is
required for Python 3.
(From OE-Core rev: 24b0ba00d4f0b4d9834f7693ecb6032dfc534a80)
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool/create_buildsys.py')
-rw-r--r-- | scripts/lib/recipetool/create_buildsys.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py index d4b194f567..ec9d510e23 100644 --- a/scripts/lib/recipetool/create_buildsys.py +++ b/scripts/lib/recipetool/create_buildsys.py | |||
@@ -137,15 +137,15 @@ class CmakeRecipeHandler(RecipeHandler): | |||
137 | deps = [] | 137 | deps = [] |
138 | unmappedpkgs = [] | 138 | unmappedpkgs = [] |
139 | 139 | ||
140 | proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE) | 140 | proj_re = re.compile(r'project\s*\(([^)]*)\)', re.IGNORECASE) |
141 | pkgcm_re = re.compile('pkg_check_modules\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?\s+([^)\s]+)\s*\)', re.IGNORECASE) | 141 | pkgcm_re = re.compile(r'pkg_check_modules\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?\s+([^)\s]+)\s*\)', re.IGNORECASE) |
142 | pkgsm_re = re.compile('pkg_search_module\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?((\s+[^)\s]+)+)\s*\)', re.IGNORECASE) | 142 | pkgsm_re = re.compile(r'pkg_search_module\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?((\s+[^)\s]+)+)\s*\)', re.IGNORECASE) |
143 | findpackage_re = re.compile('find_package\s*\(\s*([a-zA-Z0-9-_]+)\s*.*', re.IGNORECASE) | 143 | findpackage_re = re.compile(r'find_package\s*\(\s*([a-zA-Z0-9-_]+)\s*.*', re.IGNORECASE) |
144 | findlibrary_re = re.compile('find_library\s*\(\s*[a-zA-Z0-9-_]+\s*(NAMES\s+)?([a-zA-Z0-9-_ ]+)\s*.*') | 144 | findlibrary_re = re.compile(r'find_library\s*\(\s*[a-zA-Z0-9-_]+\s*(NAMES\s+)?([a-zA-Z0-9-_ ]+)\s*.*') |
145 | checklib_re = re.compile('check_library_exists\s*\(\s*([^\s)]+)\s*.*', re.IGNORECASE) | 145 | checklib_re = re.compile(r'check_library_exists\s*\(\s*([^\s)]+)\s*.*', re.IGNORECASE) |
146 | include_re = re.compile('include\s*\(\s*([^)\s]*)\s*\)', re.IGNORECASE) | 146 | include_re = re.compile(r'include\s*\(\s*([^)\s]*)\s*\)', re.IGNORECASE) |
147 | subdir_re = re.compile('add_subdirectory\s*\(\s*([^)\s]*)\s*([^)\s]*)\s*\)', re.IGNORECASE) | 147 | subdir_re = re.compile(r'add_subdirectory\s*\(\s*([^)\s]*)\s*([^)\s]*)\s*\)', re.IGNORECASE) |
148 | dep_re = re.compile('([^ ><=]+)( *[<>=]+ *[^ ><=]+)?') | 148 | dep_re = re.compile(r'([^ ><=]+)( *[<>=]+ *[^ ><=]+)?') |
149 | 149 | ||
150 | def find_cmake_package(pkg): | 150 | def find_cmake_package(pkg): |
151 | RecipeHandler.load_devel_filemap(tinfoil.config_data) | 151 | RecipeHandler.load_devel_filemap(tinfoil.config_data) |
@@ -423,16 +423,16 @@ class AutotoolsRecipeHandler(RecipeHandler): | |||
423 | 'makeinfo': 'texinfo', | 423 | 'makeinfo': 'texinfo', |
424 | } | 424 | } |
425 | 425 | ||
426 | pkg_re = re.compile('PKG_CHECK_MODULES\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') | 426 | pkg_re = re.compile(r'PKG_CHECK_MODULES\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') |
427 | pkgce_re = re.compile('PKG_CHECK_EXISTS\(\s*\[?([^,\]]*)\]?[),].*') | 427 | pkgce_re = re.compile(r'PKG_CHECK_EXISTS\(\s*\[?([^,\]]*)\]?[),].*') |
428 | lib_re = re.compile('AC_CHECK_LIB\(\s*\[?([^,\]]*)\]?,.*') | 428 | lib_re = re.compile(r'AC_CHECK_LIB\(\s*\[?([^,\]]*)\]?,.*') |
429 | libx_re = re.compile('AX_CHECK_LIBRARY\(\s*\[?[^,\]]*\]?,\s*\[?([^,\]]*)\]?,\s*\[?([a-zA-Z0-9-]*)\]?,.*') | 429 | libx_re = re.compile(r'AX_CHECK_LIBRARY\(\s*\[?[^,\]]*\]?,\s*\[?([^,\]]*)\]?,\s*\[?([a-zA-Z0-9-]*)\]?,.*') |
430 | progs_re = re.compile('_PROGS?\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') | 430 | progs_re = re.compile(r'_PROGS?\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') |
431 | dep_re = re.compile('([^ ><=]+)( [<>=]+ [^ ><=]+)?') | 431 | dep_re = re.compile(r'([^ ><=]+)( [<>=]+ [^ ><=]+)?') |
432 | ac_init_re = re.compile('AC_INIT\(\s*([^,]+),\s*([^,]+)[,)].*') | 432 | ac_init_re = re.compile(r'AC_INIT\(\s*([^,]+),\s*([^,]+)[,)].*') |
433 | am_init_re = re.compile('AM_INIT_AUTOMAKE\(\s*([^,]+),\s*([^,]+)[,)].*') | 433 | am_init_re = re.compile(r'AM_INIT_AUTOMAKE\(\s*([^,]+),\s*([^,]+)[,)].*') |
434 | define_re = re.compile('\s*(m4_)?define\(\s*([^,]+),\s*([^,]+)\)') | 434 | define_re = re.compile(r'\s*(m4_)?define\(\s*([^,]+),\s*([^,]+)\)') |
435 | version_re = re.compile('([0-9.]+)') | 435 | version_re = re.compile(r'([0-9.]+)') |
436 | 436 | ||
437 | defines = {} | 437 | defines = {} |
438 | def subst_defines(value): | 438 | def subst_defines(value): |