summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
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/classes/package.bbclass
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/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass22
1 files changed, 11 insertions, 11 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 7a7bc9e2f0..853735f0c6 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -75,7 +75,7 @@ def legitimize_package_name(s):
75 return ('\\u%s' % cp).encode('latin-1').decode('unicode_escape') 75 return ('\\u%s' % cp).encode('latin-1').decode('unicode_escape')
76 76
77 # Handle unicode codepoints encoded as <U0123>, as in glibc locale files. 77 # Handle unicode codepoints encoded as <U0123>, as in glibc locale files.
78 s = re.sub('<U([0-9A-Fa-f]{1,4})>', fixutf, s) 78 s = re.sub(r'<U([0-9A-Fa-f]{1,4})>', fixutf, s)
79 79
80 # Remaining package name validity fixes 80 # Remaining package name validity fixes
81 return s.lower().replace('_', '-').replace('@', '+').replace(',', '+').replace('/', '-') 81 return s.lower().replace('_', '-').replace('@', '+').replace(',', '+').replace('/', '-')
@@ -1590,8 +1590,8 @@ python package_do_shlibs() {
1590 bb.note("not generating shlibs") 1590 bb.note("not generating shlibs")
1591 return 1591 return
1592 1592
1593 lib_re = re.compile("^.*\.so") 1593 lib_re = re.compile(r"^.*\.so")
1594 libdir_re = re.compile(".*/%s$" % d.getVar('baselib')) 1594 libdir_re = re.compile(r".*/%s$" % d.getVar('baselib'))
1595 1595
1596 packages = d.getVar('PACKAGES') 1596 packages = d.getVar('PACKAGES')
1597 1597
@@ -1632,17 +1632,17 @@ python package_do_shlibs() {
1632 fd.close() 1632 fd.close()
1633 rpath = tuple() 1633 rpath = tuple()
1634 for l in lines: 1634 for l in lines:
1635 m = re.match("\s+RPATH\s+([^\s]*)", l) 1635 m = re.match(r"\s+RPATH\s+([^\s]*)", l)
1636 if m: 1636 if m:
1637 rpaths = m.group(1).replace("$ORIGIN", ldir).split(":") 1637 rpaths = m.group(1).replace("$ORIGIN", ldir).split(":")
1638 rpath = tuple(map(os.path.normpath, rpaths)) 1638 rpath = tuple(map(os.path.normpath, rpaths))
1639 for l in lines: 1639 for l in lines:
1640 m = re.match("\s+NEEDED\s+([^\s]*)", l) 1640 m = re.match(r"\s+NEEDED\s+([^\s]*)", l)
1641 if m: 1641 if m:
1642 dep = m.group(1) 1642 dep = m.group(1)
1643 if dep not in needed: 1643 if dep not in needed:
1644 needed.add((dep, file, rpath)) 1644 needed.add((dep, file, rpath))
1645 m = re.match("\s+SONAME\s+([^\s]*)", l) 1645 m = re.match(r"\s+SONAME\s+([^\s]*)", l)
1646 if m: 1646 if m:
1647 this_soname = m.group(1) 1647 this_soname = m.group(1)
1648 prov = (this_soname, ldir, pkgver) 1648 prov = (this_soname, ldir, pkgver)
@@ -1722,7 +1722,7 @@ python package_do_shlibs() {
1722 out, err = p.communicate() 1722 out, err = p.communicate()
1723 # process the output, grabbing all .dll names 1723 # process the output, grabbing all .dll names
1724 if p.returncode == 0: 1724 if p.returncode == 0:
1725 for m in re.finditer("DLL Name: (.*?\.dll)$", out.decode(), re.MULTILINE | re.IGNORECASE): 1725 for m in re.finditer(r"DLL Name: (.*?\.dll)$", out.decode(), re.MULTILINE | re.IGNORECASE):
1726 dllname = m.group(1) 1726 dllname = m.group(1)
1727 if dllname: 1727 if dllname:
1728 needed[pkg].add((dllname, file, tuple())) 1728 needed[pkg].add((dllname, file, tuple()))
@@ -1883,9 +1883,9 @@ python package_do_pkgconfig () {
1883 shlibs_dirs = d.getVar('SHLIBSDIRS').split() 1883 shlibs_dirs = d.getVar('SHLIBSDIRS').split()
1884 shlibswork_dir = d.getVar('SHLIBSWORKDIR') 1884 shlibswork_dir = d.getVar('SHLIBSWORKDIR')
1885 1885
1886 pc_re = re.compile('(.*)\.pc$') 1886 pc_re = re.compile(r'(.*)\.pc$')
1887 var_re = re.compile('(.*)=(.*)') 1887 var_re = re.compile(r'(.*)=(.*)')
1888 field_re = re.compile('(.*): (.*)') 1888 field_re = re.compile(r'(.*): (.*)')
1889 1889
1890 pkgconfig_provided = {} 1890 pkgconfig_provided = {}
1891 pkgconfig_needed = {} 1891 pkgconfig_needed = {}
@@ -1933,7 +1933,7 @@ python package_do_pkgconfig () {
1933 if not os.path.exists(dir): 1933 if not os.path.exists(dir):
1934 continue 1934 continue
1935 for file in os.listdir(dir): 1935 for file in os.listdir(dir):
1936 m = re.match('^(.*)\.pclist$', file) 1936 m = re.match(r'^(.*)\.pclist$', file)
1937 if m: 1937 if m:
1938 pkg = m.group(1) 1938 pkg = m.group(1)
1939 fd = open(os.path.join(dir, file)) 1939 fd = open(os.path.join(dir, file))