summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/rootfs.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-14 15:49:50 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-16 15:35:07 +0000
commitcd4b8a8553f9d551af27941910cf4d3405ecb7b0 (patch)
tree4f2c58eca95fd5ea9a4538a66a4875fd9d947b0d /meta/lib/oe/rootfs.py
parent1ee53881eea3a7ca4d4f6a5ca9c4c6e6488d2348 (diff)
downloadpoky-cd4b8a8553f9d551af27941910cf4d3405ecb7b0.tar.gz
meta: Fix Deprecated warnings from regexs
Fix handling of escape characters in regexs and hence fix python Deprecation warnings which will be problematic in python 3.8. Note that some show up as: """ meta/classes/package.bbclass:1293: DeprecationWarning: invalid escape sequence \.   """ where the problem isn't on 1293 in package.bbclass but in some _prepend to a package.bbclass function in a different file like mesa.inc, often from do_package_split() calls. (From OE-Core rev: 4b1c0c7d5525fc4cea9e0f02ec54e92a6fbc6199) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/rootfs.py')
-rw-r--r--meta/lib/oe/rootfs.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 4273891699..551dcfc75f 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -354,9 +354,9 @@ class Rootfs(object, metaclass=ABCMeta):
354class RpmRootfs(Rootfs): 354class RpmRootfs(Rootfs):
355 def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None): 355 def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None):
356 super(RpmRootfs, self).__init__(d, progress_reporter, logcatcher) 356 super(RpmRootfs, self).__init__(d, progress_reporter, logcatcher)
357 self.log_check_regex = '(unpacking of archive failed|Cannot find package'\ 357 self.log_check_regex = r'(unpacking of archive failed|Cannot find package'\
358 '|exit 1|ERROR: |Error: |Error |ERROR '\ 358 r'|exit 1|ERROR: |Error: |Error |ERROR '\
359 '|Failed |Failed: |Failed$|Failed\(\d+\):)' 359 r'|Failed |Failed: |Failed$|Failed\(\d+\):)'
360 self.manifest = RpmManifest(d, manifest_dir) 360 self.manifest = RpmManifest(d, manifest_dir)
361 361
362 self.pm = RpmPM(d, 362 self.pm = RpmPM(d,
@@ -499,7 +499,7 @@ class DpkgOpkgRootfs(Rootfs):
499 pkg_depends_list = [] 499 pkg_depends_list = []
500 # filter version requirements like libc (>= 1.1) 500 # filter version requirements like libc (>= 1.1)
501 for dep in pkg_depends.split(', '): 501 for dep in pkg_depends.split(', '):
502 m_dep = re.match("^(.*) \(.*\)$", dep) 502 m_dep = re.match(r"^(.*) \(.*\)$", dep)
503 if m_dep: 503 if m_dep:
504 dep = m_dep.group(1) 504 dep = m_dep.group(1)
505 pkg_depends_list.append(dep) 505 pkg_depends_list.append(dep)
@@ -515,9 +515,9 @@ class DpkgOpkgRootfs(Rootfs):
515 data = status.read() 515 data = status.read()
516 status.close() 516 status.close()
517 for line in data.split('\n'): 517 for line in data.split('\n'):
518 m_pkg = re.match("^Package: (.*)", line) 518 m_pkg = re.match(r"^Package: (.*)", line)
519 m_status = re.match("^Status:.*unpacked", line) 519 m_status = re.match(r"^Status:.*unpacked", line)
520 m_depends = re.match("^Depends: (.*)", line) 520 m_depends = re.match(r"^Depends: (.*)", line)
521 521
522 #Only one of m_pkg, m_status or m_depends is not None at time 522 #Only one of m_pkg, m_status or m_depends is not None at time
523 #If m_pkg is not None, we started a new package 523 #If m_pkg is not None, we started a new package
@@ -771,7 +771,7 @@ class OpkgRootfs(DpkgOpkgRootfs):
771 if allow_replace is None: 771 if allow_replace is None:
772 allow_replace = "" 772 allow_replace = ""
773 773
774 allow_rep = re.compile(re.sub("\|$", "", allow_replace)) 774 allow_rep = re.compile(re.sub(r"\|$", r"", allow_replace))
775 error_prompt = "Multilib check error:" 775 error_prompt = "Multilib check error:"
776 776
777 files = {} 777 files = {}