summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Orling <timothy.t.orling@linux.intel.com>2020-07-10 20:48:08 -0700
committerSteve Sakoman <steve@sakoman.com>2020-07-13 17:16:12 -1000
commitf8a5db7a6072ddb1be96405fc8b44f595275206d (patch)
tree9f1c6216380daf3409a790dc8aef638ed23be49a
parent2a1ae8c12cb0d6fd9d57c98caa97a10f3b6d3388 (diff)
downloadopenembedded-core-f8a5db7a6072ddb1be96405fc8b44f595275206d.tar.gz
scripts/lib/recipetool/create.py: fix regex strings
Python now expects regex strings to be prepended with r. Silence pylint/autopep8 and similar warnings by identifying these regex patterns as... regex patterns. Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0eae98a369d80340e48dc690d09a1364cde97973) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--scripts/lib/recipetool/create.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 8d78c5b6f9..566c75369a 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -66,7 +66,7 @@ class RecipeHandler(object):
libdir = d.getVar('libdir')
base_libdir = d.getVar('base_libdir')
libpaths = list(set([base_libdir, libdir]))
- libname_re = re.compile('^lib(.+)\.so.*$')
+ libname_re = re.compile(r'^lib(.+)\.so.*$')
pkglibmap = {}
for lib, item in shlib_providers.items():
for path, pkg in item.items():
@@ -428,7 +428,7 @@ def create_recipe(args):
if scriptutils.is_src_url(source):
# Warn about github archive URLs
- if re.match('https?://github.com/[^/]+/[^/]+/archive/.+(\.tar\..*|\.zip)$', source):
+ if re.match(r'https?://github.com/[^/]+/[^/]+/archive/.+(\.tar\..*|\.zip)$', source):
logger.warning('github archive files are not guaranteed to be stable and may be re-generated over time. If the latter occurs, the checksums will likely change and the recipe will fail at do_fetch. It is recommended that you point to an actual commit or tag in the repository instead (using the repository URL in conjunction with the -S/--srcrev option).')
# Fetch a URL
fetchuri = reformat_git_uri(urldefrag(source)[0])
@@ -830,7 +830,7 @@ def create_recipe(args):
elif line.startswith('PV = '):
if realpv:
# Replace the first part of the PV value
- line = re.sub('"[^+]*\+', '"%s+' % realpv, line)
+ line = re.sub(r'"[^+]*\+', '"%s+' % realpv, line)
lines_before.append(line)
if args.also_native:
@@ -1066,8 +1066,8 @@ def crunch_license(licfile):
import oe.utils
# Note: these are carefully constructed!
- license_title_re = re.compile('^\(?(#+ *)?(The )?.{1,10} [Ll]icen[sc]e( \(.{1,10}\))?\)?:?$')
- license_statement_re = re.compile('^(This (project|software) is( free software)? (released|licen[sc]ed)|(Released|Licen[cs]ed)) under the .{1,10} [Ll]icen[sc]e:?$')
+ license_title_re = re.compile(r'^\(?(#+ *)?(The )?.{1,10} [Ll]icen[sc]e( \(.{1,10}\))?\)?:?$')
+ license_statement_re = re.compile(r'^(This (project|software) is( free software)? (released|licen[sc]ed)|(Released|Licen[cs]ed)) under the .{1,10} [Ll]icen[sc]e:?$')
copyright_re = re.compile('^(#+)? *Copyright .*$')
crunched_md5sums = {}