summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2024-02-21 20:36:54 +0100
committerSteve Sakoman <steve@sakoman.com>2024-03-01 05:19:53 -1000
commit1e41c667e6aa41b4d7dcf90559bd93ff330a3130 (patch)
tree9f2b17e188966d857c3988a2f66c01171cf21b6f
parent6e8300c5bc6a21310efd48baf97e8a153c427533 (diff)
downloadpoky-1e41c667e6aa41b4d7dcf90559bd93ff330a3130.tar.gz
scripts/runqemu: fix regex escape sequences
When invoking runqemu with Python 3.12, the following warning is encountered: |SyntaxWarning: invalid escape sequence '\.' This is because the interpreter scans the string before it is processed by the regex module, and it interprets the backslash as part of an escape sequence, but not a standard one. This will be registered as an error rather than a warning in future Python versions. To avoid the it, simply add an extra backslash so that Python doesn't misinterpret the string, while the regex parser still sees an escaped '.' character. (From OE-Core rev: 2f8982ef4c903f43867da56fcfd080a6556daa8b) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Backported from master: 0e8a4142bb90a92d175df6b2537d24a372356f98 Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rwxr-xr-xscripts/runqemu8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 8e5d22888d..81d95133b6 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -362,7 +362,7 @@ class BaseConfig(object):
362 if p.endswith('.qemuboot.conf'): 362 if p.endswith('.qemuboot.conf'):
363 self.qemuboot = p 363 self.qemuboot = p
364 self.qbconfload = True 364 self.qbconfload = True
365 elif re.search('\.bin$', p) or re.search('bzImage', p) or \ 365 elif re.search('\\.bin$', p) or re.search('bzImage', p) or \
366 re.search('zImage', p) or re.search('vmlinux', p) or \ 366 re.search('zImage', p) or re.search('vmlinux', p) or \
367 re.search('fitImage', p) or re.search('uImage', p): 367 re.search('fitImage', p) or re.search('uImage', p):
368 self.kernel = p 368 self.kernel = p
@@ -376,13 +376,13 @@ class BaseConfig(object):
376 fst = t 376 fst = t
377 break 377 break
378 if not fst: 378 if not fst:
379 m = re.search('.*\.(.*)$', self.rootfs) 379 m = re.search('.*\\.(.*)$', self.rootfs)
380 if m: 380 if m:
381 fst = m.group(1) 381 fst = m.group(1)
382 if fst: 382 if fst:
383 self.check_arg_fstype(fst) 383 self.check_arg_fstype(fst)
384 qb = re.sub('\.' + fst + "$", '', self.rootfs) 384 qb = re.sub('\\.' + fst + "$", '', self.rootfs)
385 qb = '%s%s' % (re.sub('\.rootfs$', '', qb), '.qemuboot.conf') 385 qb = '%s%s' % (re.sub('\\.rootfs$', '', qb), '.qemuboot.conf')
386 if os.path.exists(qb): 386 if os.path.exists(qb):
387 self.qemuboot = qb 387 self.qemuboot = qb
388 self.qbconfload = True 388 self.qbconfload = True