diff options
author | Tim Orling <timothy.t.orling@linux.intel.com> | 2020-07-10 20:48:08 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-12 22:39:41 +0100 |
commit | e25b9820000687b5ee4a681497edd13f15c3b30a (patch) | |
tree | 814ea42629cebf377c0247c50cd89e92b2b6ffb4 /scripts | |
parent | c9ba6e7bfe35bc46aad3855b76e479c8151d19de (diff) | |
download | poky-e25b9820000687b5ee4a681497edd13f15c3b30a.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.
(From OE-Core rev: 0eae98a369d80340e48dc690d09a1364cde97973)
Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/recipetool/create.py | 10 |
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): | |||
66 | libdir = d.getVar('libdir') | 66 | libdir = d.getVar('libdir') |
67 | base_libdir = d.getVar('base_libdir') | 67 | base_libdir = d.getVar('base_libdir') |
68 | libpaths = list(set([base_libdir, libdir])) | 68 | libpaths = list(set([base_libdir, libdir])) |
69 | libname_re = re.compile('^lib(.+)\.so.*$') | 69 | libname_re = re.compile(r'^lib(.+)\.so.*$') |
70 | pkglibmap = {} | 70 | pkglibmap = {} |
71 | for lib, item in shlib_providers.items(): | 71 | for lib, item in shlib_providers.items(): |
72 | for path, pkg in item.items(): | 72 | for path, pkg in item.items(): |
@@ -428,7 +428,7 @@ def create_recipe(args): | |||
428 | 428 | ||
429 | if scriptutils.is_src_url(source): | 429 | if scriptutils.is_src_url(source): |
430 | # Warn about github archive URLs | 430 | # Warn about github archive URLs |
431 | if re.match('https?://github.com/[^/]+/[^/]+/archive/.+(\.tar\..*|\.zip)$', source): | 431 | if re.match(r'https?://github.com/[^/]+/[^/]+/archive/.+(\.tar\..*|\.zip)$', source): |
432 | 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).') | 432 | 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).') |
433 | # Fetch a URL | 433 | # Fetch a URL |
434 | fetchuri = reformat_git_uri(urldefrag(source)[0]) | 434 | fetchuri = reformat_git_uri(urldefrag(source)[0]) |
@@ -830,7 +830,7 @@ def create_recipe(args): | |||
830 | elif line.startswith('PV = '): | 830 | elif line.startswith('PV = '): |
831 | if realpv: | 831 | if realpv: |
832 | # Replace the first part of the PV value | 832 | # Replace the first part of the PV value |
833 | line = re.sub('"[^+]*\+', '"%s+' % realpv, line) | 833 | line = re.sub(r'"[^+]*\+', '"%s+' % realpv, line) |
834 | lines_before.append(line) | 834 | lines_before.append(line) |
835 | 835 | ||
836 | if args.also_native: | 836 | if args.also_native: |
@@ -1066,8 +1066,8 @@ def crunch_license(licfile): | |||
1066 | import oe.utils | 1066 | import oe.utils |
1067 | 1067 | ||
1068 | # Note: these are carefully constructed! | 1068 | # Note: these are carefully constructed! |
1069 | license_title_re = re.compile('^\(?(#+ *)?(The )?.{1,10} [Ll]icen[sc]e( \(.{1,10}\))?\)?:?$') | 1069 | license_title_re = re.compile(r'^\(?(#+ *)?(The )?.{1,10} [Ll]icen[sc]e( \(.{1,10}\))?\)?:?$') |
1070 | 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:?$') | 1070 | 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:?$') |
1071 | copyright_re = re.compile('^(#+)? *Copyright .*$') | 1071 | copyright_re = re.compile('^(#+)? *Copyright .*$') |
1072 | 1072 | ||
1073 | crunched_md5sums = {} | 1073 | crunched_md5sums = {} |