diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-12-07 00:04:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-12-08 17:17:01 +0000 |
commit | 7843548285e2eea8158670316058fff4b769c236 (patch) | |
tree | 1abc8618037b3e34b1a0fe93f8a38b93e5e1c0f4 /meta/classes | |
parent | 0985ac745f978396086417a25c1271e28ec65b2d (diff) | |
download | poky-7843548285e2eea8158670316058fff4b769c236.tar.gz |
classes: Correctly markup regex strings
There are various escape characters in these stings which python warns
about so use the correct regex markup for them.
(From OE-Core rev: 252b69c9f2abe3258366c540f56b156ed63e5437)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/clutter.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/cmake.bbclass | 2 | ||||
-rw-r--r-- | meta/classes/insane.bbclass | 16 | ||||
-rw-r--r-- | meta/classes/license_image.bbclass | 14 | ||||
-rw-r--r-- | meta/classes/perl-version.bbclass | 2 |
5 files changed, 19 insertions, 19 deletions
diff --git a/meta/classes/clutter.bbclass b/meta/classes/clutter.bbclass index 8550363bdf..5edab0e55d 100644 --- a/meta/classes/clutter.bbclass +++ b/meta/classes/clutter.bbclass | |||
@@ -1,11 +1,11 @@ | |||
1 | def get_minor_dir(v): | 1 | def get_minor_dir(v): |
2 | import re | 2 | import re |
3 | m = re.match("^([0-9]+)\.([0-9]+)", v) | 3 | m = re.match(r"^([0-9]+)\.([0-9]+)", v) |
4 | return "%s.%s" % (m.group(1), m.group(2)) | 4 | return "%s.%s" % (m.group(1), m.group(2)) |
5 | 5 | ||
6 | def get_real_name(n): | 6 | def get_real_name(n): |
7 | import re | 7 | import re |
8 | m = re.match("^([a-z]+(-[a-z]+)?)(-[0-9]+\.[0-9]+)?", n) | 8 | m = re.match(r"^([a-z]+(-[a-z]+)?)(-[0-9]+\.[0-9]+)?", n) |
9 | return "%s" % (m.group(1)) | 9 | return "%s" % (m.group(1)) |
10 | 10 | ||
11 | VERMINOR = "${@get_minor_dir("${PV}")}" | 11 | VERMINOR = "${@get_minor_dir("${PV}")}" |
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index fd40a9863e..b364d2bc20 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass | |||
@@ -20,7 +20,7 @@ python() { | |||
20 | elif generator == "Ninja": | 20 | elif generator == "Ninja": |
21 | d.appendVar("DEPENDS", " ninja-native") | 21 | d.appendVar("DEPENDS", " ninja-native") |
22 | d.setVar("OECMAKE_GENERATOR_ARGS", "-G Ninja -DCMAKE_MAKE_PROGRAM=ninja") | 22 | d.setVar("OECMAKE_GENERATOR_ARGS", "-G Ninja -DCMAKE_MAKE_PROGRAM=ninja") |
23 | d.setVarFlag("do_compile", "progress", "outof:^\[(\d+)/(\d+)\]\s+") | 23 | d.setVarFlag("do_compile", "progress", r"outof:^\[(\d+)/(\d+)\]\s+") |
24 | else: | 24 | else: |
25 | bb.fatal("Unknown CMake Generator %s" % generator) | 25 | bb.fatal("Unknown CMake Generator %s" % generator) |
26 | } | 26 | } |
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 6718feb3af..295feb8a5f 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -111,7 +111,7 @@ def package_qa_check_rpath(file,name, d, elf, messages): | |||
111 | phdrs = elf.run_objdump("-p", d) | 111 | phdrs = elf.run_objdump("-p", d) |
112 | 112 | ||
113 | import re | 113 | import re |
114 | rpath_re = re.compile("\s+RPATH\s+(.*)") | 114 | rpath_re = re.compile(r"\s+RPATH\s+(.*)") |
115 | for line in phdrs.split("\n"): | 115 | for line in phdrs.split("\n"): |
116 | m = rpath_re.match(line) | 116 | m = rpath_re.match(line) |
117 | if m: | 117 | if m: |
@@ -140,7 +140,7 @@ def package_qa_check_useless_rpaths(file, name, d, elf, messages): | |||
140 | phdrs = elf.run_objdump("-p", d) | 140 | phdrs = elf.run_objdump("-p", d) |
141 | 141 | ||
142 | import re | 142 | import re |
143 | rpath_re = re.compile("\s+RPATH\s+(.*)") | 143 | rpath_re = re.compile(r"\s+RPATH\s+(.*)") |
144 | for line in phdrs.split("\n"): | 144 | for line in phdrs.split("\n"): |
145 | m = rpath_re.match(line) | 145 | m = rpath_re.match(line) |
146 | if m: | 146 | if m: |
@@ -203,8 +203,8 @@ def package_qa_check_libdir(d): | |||
203 | # The re's are purposely fuzzy, as some there are some .so.x.y.z files | 203 | # The re's are purposely fuzzy, as some there are some .so.x.y.z files |
204 | # that don't follow the standard naming convention. It checks later | 204 | # that don't follow the standard naming convention. It checks later |
205 | # that they are actual ELF files | 205 | # that they are actual ELF files |
206 | lib_re = re.compile("^/lib.+\.so(\..+)?$") | 206 | lib_re = re.compile(r"^/lib.+\.so(\..+)?$") |
207 | exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix) | 207 | exec_re = re.compile(r"^%s.*/lib.+\.so(\..+)?$" % exec_prefix) |
208 | 208 | ||
209 | for root, dirs, files in os.walk(pkgdest): | 209 | for root, dirs, files in os.walk(pkgdest): |
210 | if root == pkgdest: | 210 | if root == pkgdest: |
@@ -302,7 +302,7 @@ def package_qa_check_arch(path,name,d, elf, messages): | |||
302 | # Check the architecture and endiannes of the binary | 302 | # Check the architecture and endiannes of the binary |
303 | is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \ | 303 | is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \ |
304 | (target_os == "linux-gnux32" or target_os == "linux-muslx32" or \ | 304 | (target_os == "linux-gnux32" or target_os == "linux-muslx32" or \ |
305 | target_os == "linux-gnu_ilp32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE'))) | 305 | target_os == "linux-gnu_ilp32" or re.match(r'mips64.*32', d.getVar('DEFAULTTUNE'))) |
306 | is_bpf = (oe.qa.elf_machine_to_string(elf.machine()) == "BPF") | 306 | is_bpf = (oe.qa.elf_machine_to_string(elf.machine()) == "BPF") |
307 | if not ((machine == elf.machine()) or is_32 or is_bpf): | 307 | if not ((machine == elf.machine()) or is_32 or is_bpf): |
308 | package_qa_add_message(messages, "arch", "Architecture did not match (%s, expected %s) on %s" % \ | 308 | package_qa_add_message(messages, "arch", "Architecture did not match (%s, expected %s) on %s" % \ |
@@ -342,7 +342,7 @@ def package_qa_textrel(path, name, d, elf, messages): | |||
342 | sane = True | 342 | sane = True |
343 | 343 | ||
344 | import re | 344 | import re |
345 | textrel_re = re.compile("\s+TEXTREL\s+") | 345 | textrel_re = re.compile(r"\s+TEXTREL\s+") |
346 | for line in phdrs.split("\n"): | 346 | for line in phdrs.split("\n"): |
347 | if textrel_re.match(line): | 347 | if textrel_re.match(line): |
348 | sane = False | 348 | sane = False |
@@ -952,7 +952,7 @@ python do_package_qa () { | |||
952 | 952 | ||
953 | import re | 953 | import re |
954 | # The package name matches the [a-z0-9.+-]+ regular expression | 954 | # The package name matches the [a-z0-9.+-]+ regular expression |
955 | pkgname_pattern = re.compile("^[a-z0-9.+-]+$") | 955 | pkgname_pattern = re.compile(r"^[a-z0-9.+-]+$") |
956 | 956 | ||
957 | taskdepdata = d.getVar("BB_TASKDEPDATA", False) | 957 | taskdepdata = d.getVar("BB_TASKDEPDATA", False) |
958 | taskdeps = set() | 958 | taskdeps = set() |
@@ -1160,7 +1160,7 @@ python () { | |||
1160 | if pn in overrides: | 1160 | if pn in overrides: |
1161 | msg = 'Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE"), pn) | 1161 | msg = 'Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE"), pn) |
1162 | package_qa_handle_error("pn-overrides", msg, d) | 1162 | package_qa_handle_error("pn-overrides", msg, d) |
1163 | prog = re.compile('[A-Z]') | 1163 | prog = re.compile(r'[A-Z]') |
1164 | if prog.search(pn): | 1164 | if prog.search(pn): |
1165 | package_qa_handle_error("uppercase-pn", 'PN: %s is upper case, this can result in unexpected behavior.' % pn, d) | 1165 | package_qa_handle_error("uppercase-pn", 'PN: %s is upper case, this can result in unexpected behavior.' % pn, d) |
1166 | 1166 | ||
diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass index 6515ee8278..6ac63e0192 100644 --- a/meta/classes/license_image.bbclass +++ b/meta/classes/license_image.bbclass | |||
@@ -52,8 +52,8 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
52 | except oe.license.LicenseError as exc: | 52 | except oe.license.LicenseError as exc: |
53 | bb.fatal('%s: %s' % (d.getVar('P'), exc)) | 53 | bb.fatal('%s: %s' % (d.getVar('P'), exc)) |
54 | else: | 54 | else: |
55 | pkg_dic[pkg]["LICENSES"] = re.sub('[|&()*]', ' ', pkg_dic[pkg]["LICENSE"]) | 55 | pkg_dic[pkg]["LICENSES"] = re.sub(r'[|&()*]', ' ', pkg_dic[pkg]["LICENSE"]) |
56 | pkg_dic[pkg]["LICENSES"] = re.sub(' *', ' ', pkg_dic[pkg]["LICENSES"]) | 56 | pkg_dic[pkg]["LICENSES"] = re.sub(r' *', ' ', pkg_dic[pkg]["LICENSES"]) |
57 | pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split() | 57 | pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split() |
58 | 58 | ||
59 | if not "IMAGE_MANIFEST" in pkg_dic[pkg]: | 59 | if not "IMAGE_MANIFEST" in pkg_dic[pkg]: |
@@ -78,7 +78,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
78 | for lic in pkg_dic[pkg]["LICENSES"]: | 78 | for lic in pkg_dic[pkg]["LICENSES"]: |
79 | lic_file = os.path.join(d.getVar('LICENSE_DIRECTORY'), | 79 | lic_file = os.path.join(d.getVar('LICENSE_DIRECTORY'), |
80 | pkg_dic[pkg]["PN"], "generic_%s" % | 80 | pkg_dic[pkg]["PN"], "generic_%s" % |
81 | re.sub('\+', '', lic)) | 81 | re.sub(r'\+', '', lic)) |
82 | # add explicity avoid of CLOSED license because isn't generic | 82 | # add explicity avoid of CLOSED license because isn't generic |
83 | if lic == "CLOSED": | 83 | if lic == "CLOSED": |
84 | continue | 84 | continue |
@@ -119,14 +119,14 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
119 | pkg_license = os.path.join(pkg_license_dir, lic) | 119 | pkg_license = os.path.join(pkg_license_dir, lic) |
120 | pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) | 120 | pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) |
121 | 121 | ||
122 | if re.match("^generic_.*$", lic): | 122 | if re.match(r"^generic_.*$", lic): |
123 | generic_lic = canonical_license(d, | 123 | generic_lic = canonical_license(d, |
124 | re.search("^generic_(.*)$", lic).group(1)) | 124 | re.search(r"^generic_(.*)$", lic).group(1)) |
125 | 125 | ||
126 | # Do not copy generic license into package if isn't | 126 | # Do not copy generic license into package if isn't |
127 | # declared into LICENSES of the package. | 127 | # declared into LICENSES of the package. |
128 | if not re.sub('\+$', '', generic_lic) in \ | 128 | if not re.sub(r'\+$', '', generic_lic) in \ |
129 | [re.sub('\+', '', lic) for lic in \ | 129 | [re.sub(r'\+', '', lic) for lic in \ |
130 | pkg_manifest_licenses]: | 130 | pkg_manifest_licenses]: |
131 | continue | 131 | continue |
132 | 132 | ||
diff --git a/meta/classes/perl-version.bbclass b/meta/classes/perl-version.bbclass index fafe68a775..bafd96518a 100644 --- a/meta/classes/perl-version.bbclass +++ b/meta/classes/perl-version.bbclass | |||
@@ -13,7 +13,7 @@ def get_perl_version(d): | |||
13 | return None | 13 | return None |
14 | l = f.readlines(); | 14 | l = f.readlines(); |
15 | f.close(); | 15 | f.close(); |
16 | r = re.compile("^version='(\d*\.\d*\.\d*)'") | 16 | r = re.compile(r"^version='(\d*\.\d*\.\d*)'") |
17 | for s in l: | 17 | for s in l: |
18 | m = r.match(s) | 18 | m = r.match(s) |
19 | if m: | 19 | if m: |