summaryrefslogtreecommitdiffstats
path: root/meta/classes/libc-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/libc-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/libc-package.bbclass')
-rw-r--r--meta/classes/libc-package.bbclass26
1 files changed, 13 insertions, 13 deletions
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
index 82d642e15e..0b4c666a74 100644
--- a/meta/classes/libc-package.bbclass
+++ b/meta/classes/libc-package.bbclass
@@ -113,8 +113,8 @@ python package_do_split_gconvs () {
113 def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group): 113 def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group):
114 deps = [] 114 deps = []
115 f = open(fn, "rb") 115 f = open(fn, "rb")
116 c_re = re.compile('^copy "(.*)"') 116 c_re = re.compile(r'^copy "(.*)"')
117 i_re = re.compile('^include "(\w+)".*') 117 i_re = re.compile(r'^include "(\w+)".*')
118 for l in f.readlines(): 118 for l in f.readlines():
119 l = l.decode("latin-1") 119 l = l.decode("latin-1")
120 m = c_re.match(l) or i_re.match(l) 120 m = c_re.match(l) or i_re.match(l)
@@ -128,15 +128,15 @@ python package_do_split_gconvs () {
128 if bpn != 'glibc': 128 if bpn != 'glibc':
129 d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc')) 129 d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
130 130
131 do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern=bpn+'-gconv-%s', \ 131 do_split_packages(d, gconv_libdir, file_regex=r'^(.*)\.so$', output_pattern=bpn+'-gconv-%s', \
132 description='gconv module for character set %s', hook=calc_gconv_deps, \ 132 description='gconv module for character set %s', hook=calc_gconv_deps, \
133 extra_depends=bpn+'-gconv') 133 extra_depends=bpn+'-gconv')
134 134
135 def calc_charmap_deps(fn, pkg, file_regex, output_pattern, group): 135 def calc_charmap_deps(fn, pkg, file_regex, output_pattern, group):
136 deps = [] 136 deps = []
137 f = open(fn, "rb") 137 f = open(fn, "rb")
138 c_re = re.compile('^copy "(.*)"') 138 c_re = re.compile(r'^copy "(.*)"')
139 i_re = re.compile('^include "(\w+)".*') 139 i_re = re.compile(r'^include "(\w+)".*')
140 for l in f.readlines(): 140 for l in f.readlines():
141 l = l.decode("latin-1") 141 l = l.decode("latin-1")
142 m = c_re.match(l) or i_re.match(l) 142 m = c_re.match(l) or i_re.match(l)
@@ -150,14 +150,14 @@ python package_do_split_gconvs () {
150 if bpn != 'glibc': 150 if bpn != 'glibc':
151 d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc')) 151 d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
152 152
153 do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern=bpn+'-charmap-%s', \ 153 do_split_packages(d, charmap_dir, file_regex=r'^(.*)\.gz$', output_pattern=bpn+'-charmap-%s', \
154 description='character map for %s encoding', hook=calc_charmap_deps, extra_depends='') 154 description='character map for %s encoding', hook=calc_charmap_deps, extra_depends='')
155 155
156 def calc_locale_deps(fn, pkg, file_regex, output_pattern, group): 156 def calc_locale_deps(fn, pkg, file_regex, output_pattern, group):
157 deps = [] 157 deps = []
158 f = open(fn, "rb") 158 f = open(fn, "rb")
159 c_re = re.compile('^copy "(.*)"') 159 c_re = re.compile(r'^copy "(.*)"')
160 i_re = re.compile('^include "(\w+)".*') 160 i_re = re.compile(r'^include "(\w+)".*')
161 for l in f.readlines(): 161 for l in f.readlines():
162 l = l.decode("latin-1") 162 l = l.decode("latin-1")
163 m = c_re.match(l) or i_re.match(l) 163 m = c_re.match(l) or i_re.match(l)
@@ -171,13 +171,13 @@ python package_do_split_gconvs () {
171 if bpn != 'glibc': 171 if bpn != 'glibc':
172 d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc')) 172 d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
173 173
174 do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern=bpn+'-localedata-%s', \ 174 do_split_packages(d, locales_dir, file_regex=r'(.*)', output_pattern=bpn+'-localedata-%s', \
175 description='locale definition for %s', hook=calc_locale_deps, extra_depends='') 175 description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
176 d.setVar('PACKAGES', d.getVar('PACKAGES', False) + ' ' + d.getVar('MLPREFIX', False) + bpn + '-gconv') 176 d.setVar('PACKAGES', d.getVar('PACKAGES', False) + ' ' + d.getVar('MLPREFIX', False) + bpn + '-gconv')
177 177
178 use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE") 178 use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE")
179 179
180 dot_re = re.compile("(.*)\.(.*)") 180 dot_re = re.compile(r"(.*)\.(.*)")
181 181
182 # Read in supported locales and associated encodings 182 # Read in supported locales and associated encodings
183 supported = {} 183 supported = {}
@@ -290,7 +290,7 @@ python package_do_split_gconvs () {
290 d.setVar('ALLOW_EMPTY_%s' % pkgname, '1') 290 d.setVar('ALLOW_EMPTY_%s' % pkgname, '1')
291 d.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES'))) 291 d.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES')))
292 rprovides = ' %svirtual-locale-%s' % (mlprefix, legitimize_package_name(name)) 292 rprovides = ' %svirtual-locale-%s' % (mlprefix, legitimize_package_name(name))
293 m = re.match("(.*)_(.*)", name) 293 m = re.match(r"(.*)_(.*)", name)
294 if m: 294 if m:
295 rprovides += ' %svirtual-locale-%s' % (mlprefix, m.group(1)) 295 rprovides += ' %svirtual-locale-%s' % (mlprefix, m.group(1))
296 d.setVar('RPROVIDES_%s' % pkgname, rprovides) 296 d.setVar('RPROVIDES_%s' % pkgname, rprovides)
@@ -356,12 +356,12 @@ python package_do_split_gconvs () {
356 if use_bin in ('compile', 'precompiled'): 356 if use_bin in ('compile', 'precompiled'):
357 lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES') 357 lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES')
358 if lcsplit and int(lcsplit): 358 if lcsplit and int(lcsplit):
359 do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \ 359 do_split_packages(d, binary_locales_dir, file_regex=r'^(.*/LC_\w+)', \
360 output_pattern=bpn+'-binary-localedata-%s', \ 360 output_pattern=bpn+'-binary-localedata-%s', \
361 description='binary locale definition for %s', recursive=True, 361 description='binary locale definition for %s', recursive=True,
362 hook=metapkg_hook, extra_depends='', allow_dirs=True, match_path=True) 362 hook=metapkg_hook, extra_depends='', allow_dirs=True, match_path=True)
363 else: 363 else:
364 do_split_packages(d, binary_locales_dir, file_regex='(.*)', \ 364 do_split_packages(d, binary_locales_dir, file_regex=r'(.*)', \
365 output_pattern=bpn+'-binary-localedata-%s', \ 365 output_pattern=bpn+'-binary-localedata-%s', \
366 description='binary locale definition for %s', extra_depends='', allow_dirs=True) 366 description='binary locale definition for %s', extra_depends='', allow_dirs=True)
367 else: 367 else: