summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-05 14:17:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-16 08:19:34 +0000
commite1e38c9bd16220f78068299cd90692d96d045bf9 (patch)
tree61ea2bf816f730d2d48545facdce89b020e06131 /meta
parent8d2dd4a30034559838e2433ad58aeffccaf40555 (diff)
downloadpoky-e1e38c9bd16220f78068299cd90692d96d045bf9.tar.gz
lib/oe,oeqa/selftest: Fix DeprecationWarning: invalid escape sequence
Fix another load of regex escape sequence warnings for newer python versions. (From OE-Core rev: bd2c125bb9c362b6122e99dfdf4e1cfe12c26a90) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/recipeutils.py8
-rw-r--r--meta/lib/oeqa/selftest/cases/bbtests.py6
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/prservice.py4
-rw-r--r--meta/lib/oeqa/selftest/cases/sstatetests.py18
5 files changed, 19 insertions, 19 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 92c0f65257..8f70d2eb21 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -24,7 +24,7 @@ from bb.utils import vercmp_string
24# Help us to find places to insert values 24# Help us to find places to insert values
25recipe_progression = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION', 'LICENSE', 'LICENSE_FLAGS', 'LIC_FILES_CHKSUM', 'PROVIDES', 'DEPENDS', 'PR', 'PV', 'SRCREV', 'SRCPV', 'SRC_URI', 'S', 'do_fetch()', 'do_unpack()', 'do_patch()', 'EXTRA_OECONF', 'EXTRA_OECMAKE', 'EXTRA_OESCONS', 'do_configure()', 'EXTRA_OEMAKE', 'do_compile()', 'do_install()', 'do_populate_sysroot()', 'INITSCRIPT', 'USERADD', 'GROUPADD', 'PACKAGES', 'FILES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RPROVIDES', 'RREPLACES', 'RCONFLICTS', 'ALLOW_EMPTY', 'populate_packages()', 'do_package()', 'do_deploy()'] 25recipe_progression = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION', 'LICENSE', 'LICENSE_FLAGS', 'LIC_FILES_CHKSUM', 'PROVIDES', 'DEPENDS', 'PR', 'PV', 'SRCREV', 'SRCPV', 'SRC_URI', 'S', 'do_fetch()', 'do_unpack()', 'do_patch()', 'EXTRA_OECONF', 'EXTRA_OECMAKE', 'EXTRA_OESCONS', 'do_configure()', 'EXTRA_OEMAKE', 'do_compile()', 'do_install()', 'do_populate_sysroot()', 'INITSCRIPT', 'USERADD', 'GROUPADD', 'PACKAGES', 'FILES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RPROVIDES', 'RREPLACES', 'RCONFLICTS', 'ALLOW_EMPTY', 'populate_packages()', 'do_package()', 'do_deploy()']
26# Variables that sometimes are a bit long but shouldn't be wrapped 26# Variables that sometimes are a bit long but shouldn't be wrapped
27nowrap_vars = ['SUMMARY', 'HOMEPAGE', 'BUGTRACKER', 'SRC_URI\[(.+\.)?md5sum\]', 'SRC_URI\[(.+\.)?sha256sum\]'] 27nowrap_vars = ['SUMMARY', 'HOMEPAGE', 'BUGTRACKER', r'SRC_URI\[(.+\.)?md5sum\]', r'SRC_URI\[(.+\.)?sha256sum\]']
28list_vars = ['SRC_URI', 'LIC_FILES_CHKSUM'] 28list_vars = ['SRC_URI', 'LIC_FILES_CHKSUM']
29meta_vars = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION'] 29meta_vars = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION']
30 30
@@ -161,7 +161,7 @@ def patch_recipe_lines(fromlines, values, trailing_newline=True):
161 key = item[:-2] 161 key = item[:-2]
162 else: 162 else:
163 key = item 163 key = item
164 restr = '%s(_[a-zA-Z0-9-_$(){}]+|\[[^\]]*\])?' % key 164 restr = r'%s(_[a-zA-Z0-9-_$(){}]+|\[[^\]]*\])?' % key
165 if item.endswith('()'): 165 if item.endswith('()'):
166 recipe_progression_restrs.append(restr + '()') 166 recipe_progression_restrs.append(restr + '()')
167 else: 167 else:
@@ -925,7 +925,7 @@ def get_recipe_pv_without_srcpv(pv, uri_type):
925 sfx = '' 925 sfx = ''
926 926
927 if uri_type == 'git': 927 if uri_type == 'git':
928 git_regex = re.compile("(?P<pfx>v?)(?P<ver>[^\+]*)((?P<sfx>\+(git)?r?(AUTOINC\+))(?P<rev>.*))?") 928 git_regex = re.compile(r"(?P<pfx>v?)(?P<ver>[^\+]*)((?P<sfx>\+(git)?r?(AUTOINC\+))(?P<rev>.*))?")
929 m = git_regex.match(pv) 929 m = git_regex.match(pv)
930 930
931 if m: 931 if m:
@@ -933,7 +933,7 @@ def get_recipe_pv_without_srcpv(pv, uri_type):
933 pfx = m.group('pfx') 933 pfx = m.group('pfx')
934 sfx = m.group('sfx') 934 sfx = m.group('sfx')
935 else: 935 else:
936 regex = re.compile("(?P<pfx>(v|r)?)(?P<ver>.*)") 936 regex = re.compile(r"(?P<pfx>(v|r)?)(?P<ver>.*)")
937 m = regex.match(pv) 937 m = regex.match(pv)
938 if m: 938 if m:
939 pv = m.group('ver') 939 pv = m.group('ver')
diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py
index 005fdd0964..c503e4eedd 100644
--- a/meta/lib/oeqa/selftest/cases/bbtests.py
+++ b/meta/lib/oeqa/selftest/cases/bbtests.py
@@ -40,8 +40,8 @@ class BitbakeTests(OESelftestTestCase):
40 def test_event_handler(self): 40 def test_event_handler(self):
41 self.write_config("INHERIT += \"test_events\"") 41 self.write_config("INHERIT += \"test_events\"")
42 result = bitbake('m4-native') 42 result = bitbake('m4-native')
43 find_build_started = re.search("NOTE: Test for bb\.event\.BuildStarted(\n.*)*NOTE: Executing RunQueue Tasks", result.output) 43 find_build_started = re.search(r"NOTE: Test for bb\.event\.BuildStarted(\n.*)*NOTE: Executing RunQueue Tasks", result.output)
44 find_build_completed = re.search("Tasks Summary:.*(\n.*)*NOTE: Test for bb\.event\.BuildCompleted", result.output) 44 find_build_completed = re.search(r"Tasks Summary:.*(\n.*)*NOTE: Test for bb\.event\.BuildCompleted", result.output)
45 self.assertTrue(find_build_started, msg = "Match failed in:\n%s" % result.output) 45 self.assertTrue(find_build_started, msg = "Match failed in:\n%s" % result.output)
46 self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output) 46 self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output)
47 self.assertFalse('Test for bb.event.InvalidEvent' in result.output, msg = "\"Test for bb.event.InvalidEvent\" message found during bitbake process. bitbake output: %s" % result.output) 47 self.assertFalse('Test for bb.event.InvalidEvent' in result.output, msg = "\"Test for bb.event.InvalidEvent\" message found during bitbake process. bitbake output: %s" % result.output)
@@ -196,7 +196,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\"
196 @OETestID(1031) 196 @OETestID(1031)
197 def test_version(self): 197 def test_version(self):
198 result = runCmd('bitbake -s | grep wget') 198 result = runCmd('bitbake -s | grep wget')
199 find = re.search("wget *:([0-9a-zA-Z\.\-]+)", result.output) 199 find = re.search(r"wget *:([0-9a-zA-Z\.\-]+)", result.output)
200 self.assertTrue(find, "No version returned for searched recipe. bitbake output: %s" % result.output) 200 self.assertTrue(find, "No version returned for searched recipe. bitbake output: %s" % result.output)
201 201
202 @OETestID(1032) 202 @OETestID(1032)
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 9eb9badf84..58f3e58461 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -1291,7 +1291,7 @@ class DevtoolExtractTests(DevtoolBase):
1291 installdir = bb_vars['D'] 1291 installdir = bb_vars['D']
1292 fakerootenv = bb_vars['FAKEROOTENV'] 1292 fakerootenv = bb_vars['FAKEROOTENV']
1293 fakerootcmd = bb_vars['FAKEROOTCMD'] 1293 fakerootcmd = bb_vars['FAKEROOTCMD']
1294 result = runCmd('%s %s find . -type f -exec ls -l {} \;' % (fakerootenv, fakerootcmd), cwd=installdir) 1294 result = runCmd('%s %s find . -type f -exec ls -l {} \\;' % (fakerootenv, fakerootcmd), cwd=installdir)
1295 filelist1 = self._process_ls_output(result.output) 1295 filelist1 = self._process_ls_output(result.output)
1296 1296
1297 # Now look on the target 1297 # Now look on the target
diff --git a/meta/lib/oeqa/selftest/cases/prservice.py b/meta/lib/oeqa/selftest/cases/prservice.py
index 479e520618..796ad4f5fe 100644
--- a/meta/lib/oeqa/selftest/cases/prservice.py
+++ b/meta/lib/oeqa/selftest/cases/prservice.py
@@ -19,7 +19,7 @@ class BitbakePrTests(OESelftestTestCase):
19 def get_pr_version(self, package_name): 19 def get_pr_version(self, package_name):
20 package_data_file = os.path.join(self.pkgdata_dir, 'runtime', package_name) 20 package_data_file = os.path.join(self.pkgdata_dir, 'runtime', package_name)
21 package_data = ftools.read_file(package_data_file) 21 package_data = ftools.read_file(package_data_file)
22 find_pr = re.search("PKGR: r[0-9]+\.([0-9]+)", package_data) 22 find_pr = re.search(r"PKGR: r[0-9]+\.([0-9]+)", package_data)
23 self.assertTrue(find_pr, "No PKG revision found in %s" % package_data_file) 23 self.assertTrue(find_pr, "No PKG revision found in %s" % package_data_file)
24 return int(find_pr.group(1)) 24 return int(find_pr.group(1))
25 25
@@ -29,7 +29,7 @@ class BitbakePrTests(OESelftestTestCase):
29 package_stamps_path = "/".join(stampdata[:-1]) 29 package_stamps_path = "/".join(stampdata[:-1])
30 stamps = [] 30 stamps = []
31 for stamp in os.listdir(package_stamps_path): 31 for stamp in os.listdir(package_stamps_path):
32 find_stamp = re.match("%s\.%s\.([a-z0-9]{32})" % (re.escape(prefix), recipe_task), stamp) 32 find_stamp = re.match(r"%s\.%s\.([a-z0-9]{32})" % (re.escape(prefix), recipe_task), stamp)
33 if find_stamp: 33 if find_stamp:
34 stamps.append(find_stamp.group(1)) 34 stamps.append(find_stamp.group(1))
35 self.assertFalse(len(stamps) == 0, msg="Cound not find stamp for task %s for recipe %s" % (recipe_task, package_name)) 35 self.assertFalse(len(stamps) == 0, msg="Cound not find stamp for task %s for recipe %s" % (recipe_task, package_name))
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py
index 077d6e5374..938e654e9a 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -96,14 +96,14 @@ class SStateTests(SStateBase):
96 bitbake(['-ccleansstate'] + targets) 96 bitbake(['-ccleansstate'] + targets)
97 97
98 bitbake(targets) 98 bitbake(targets)
99 tgz_created = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific) 99 tgz_created = self.search_sstate('|'.join(map(str, [s + r'.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific)
100 self.assertTrue(tgz_created, msg="Could not find sstate .tgz files for: %s (%s)" % (', '.join(map(str, targets)), str(tgz_created))) 100 self.assertTrue(tgz_created, msg="Could not find sstate .tgz files for: %s (%s)" % (', '.join(map(str, targets)), str(tgz_created)))
101 101
102 siginfo_created = self.search_sstate('|'.join(map(str, [s + '.*?\.siginfo$' for s in targets])), distro_specific, distro_nonspecific) 102 siginfo_created = self.search_sstate('|'.join(map(str, [s + r'.*?\.siginfo$' for s in targets])), distro_specific, distro_nonspecific)
103 self.assertTrue(siginfo_created, msg="Could not find sstate .siginfo files for: %s (%s)" % (', '.join(map(str, targets)), str(siginfo_created))) 103 self.assertTrue(siginfo_created, msg="Could not find sstate .siginfo files for: %s (%s)" % (', '.join(map(str, targets)), str(siginfo_created)))
104 104
105 bitbake(['-ccleansstate'] + targets) 105 bitbake(['-ccleansstate'] + targets)
106 tgz_removed = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific) 106 tgz_removed = self.search_sstate('|'.join(map(str, [s + r'.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific)
107 self.assertTrue(not tgz_removed, msg="do_cleansstate didn't remove .tgz sstate files for: %s (%s)" % (', '.join(map(str, targets)), str(tgz_removed))) 107 self.assertTrue(not tgz_removed, msg="do_cleansstate didn't remove .tgz sstate files for: %s (%s)" % (', '.join(map(str, targets)), str(tgz_removed)))
108 108
109 @OETestID(977) 109 @OETestID(977)
@@ -130,14 +130,14 @@ class SStateTests(SStateBase):
130 bitbake(['-ccleansstate'] + targets) 130 bitbake(['-ccleansstate'] + targets)
131 131
132 bitbake(targets) 132 bitbake(targets)
133 results = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=False, distro_nonspecific=True) 133 results = self.search_sstate('|'.join(map(str, [s + r'.*?\.tgz$' for s in targets])), distro_specific=False, distro_nonspecific=True)
134 filtered_results = [] 134 filtered_results = []
135 for r in results: 135 for r in results:
136 if r.endswith(("_populate_lic.tgz", "_populate_lic.tgz.siginfo")): 136 if r.endswith(("_populate_lic.tgz", "_populate_lic.tgz.siginfo")):
137 continue 137 continue
138 filtered_results.append(r) 138 filtered_results.append(r)
139 self.assertTrue(filtered_results == [], msg="Found distro non-specific sstate for: %s (%s)" % (', '.join(map(str, targets)), str(filtered_results))) 139 self.assertTrue(filtered_results == [], msg="Found distro non-specific sstate for: %s (%s)" % (', '.join(map(str, targets)), str(filtered_results)))
140 file_tracker_1 = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False) 140 file_tracker_1 = self.search_sstate('|'.join(map(str, [s + r'.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False)
141 self.assertTrue(len(file_tracker_1) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets))) 141 self.assertTrue(len(file_tracker_1) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets)))
142 142
143 self.track_for_cleanup(self.distro_specific_sstate + "_old") 143 self.track_for_cleanup(self.distro_specific_sstate + "_old")
@@ -146,7 +146,7 @@ class SStateTests(SStateBase):
146 146
147 bitbake(['-cclean'] + targets) 147 bitbake(['-cclean'] + targets)
148 bitbake(targets) 148 bitbake(targets)
149 file_tracker_2 = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False) 149 file_tracker_2 = self.search_sstate('|'.join(map(str, [s + r'.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False)
150 self.assertTrue(len(file_tracker_2) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets))) 150 self.assertTrue(len(file_tracker_2) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets)))
151 151
152 not_recreated = [x for x in file_tracker_1 if x not in file_tracker_2] 152 not_recreated = [x for x in file_tracker_1 if x not in file_tracker_2]
@@ -192,18 +192,18 @@ class SStateTests(SStateBase):
192 if not sstate_arch in sstate_archs_list: 192 if not sstate_arch in sstate_archs_list:
193 sstate_archs_list.append(sstate_arch) 193 sstate_archs_list.append(sstate_arch)
194 if target_config[idx] == target_config[-1]: 194 if target_config[idx] == target_config[-1]:
195 target_sstate_before_build = self.search_sstate(target + '.*?\.tgz$') 195 target_sstate_before_build = self.search_sstate(target + r'.*?\.tgz$')
196 bitbake("-cclean %s" % target) 196 bitbake("-cclean %s" % target)
197 result = bitbake(target, ignore_status=True) 197 result = bitbake(target, ignore_status=True)
198 if target_config[idx] == target_config[-1]: 198 if target_config[idx] == target_config[-1]:
199 target_sstate_after_build = self.search_sstate(target + '.*?\.tgz$') 199 target_sstate_after_build = self.search_sstate(target + r'.*?\.tgz$')
200 expected_remaining_sstate += [x for x in target_sstate_after_build if x not in target_sstate_before_build if not any(pattern in x for pattern in ignore_patterns)] 200 expected_remaining_sstate += [x for x in target_sstate_after_build if x not in target_sstate_before_build if not any(pattern in x for pattern in ignore_patterns)]
201 self.remove_config(global_config[idx]) 201 self.remove_config(global_config[idx])
202 self.remove_recipeinc(target, target_config[idx]) 202 self.remove_recipeinc(target, target_config[idx])
203 self.assertEqual(result.status, 0, msg = "build of %s failed with %s" % (target, result.output)) 203 self.assertEqual(result.status, 0, msg = "build of %s failed with %s" % (target, result.output))
204 204
205 runCmd("sstate-cache-management.sh -y --cache-dir=%s --remove-duplicated --extra-archs=%s" % (self.sstate_path, ','.join(map(str, sstate_archs_list)))) 205 runCmd("sstate-cache-management.sh -y --cache-dir=%s --remove-duplicated --extra-archs=%s" % (self.sstate_path, ','.join(map(str, sstate_archs_list))))
206 actual_remaining_sstate = [x for x in self.search_sstate(target + '.*?\.tgz$') if not any(pattern in x for pattern in ignore_patterns)] 206 actual_remaining_sstate = [x for x in self.search_sstate(target + r'.*?\.tgz$') if not any(pattern in x for pattern in ignore_patterns)]
207 207
208 actual_not_expected = [x for x in actual_remaining_sstate if x not in expected_remaining_sstate] 208 actual_not_expected = [x for x in actual_remaining_sstate if x not in expected_remaining_sstate]
209 self.assertFalse(actual_not_expected, msg="Files should have been removed but ware not: %s" % ', '.join(map(str, actual_not_expected))) 209 self.assertFalse(actual_not_expected, msg="Files should have been removed but ware not: %s" % ', '.join(map(str, actual_not_expected)))