@@ -205,7 +205,7 @@ def get_layer_type_choices():
return (help_str, choices)
def main():
- valid_layer_name = re.compile('[-\w]+$')
+ valid_layer_name = re.compile(r'[-\w]+$')
parser = optparse.OptionParser(
usage = """
@@ -52,8 +52,8 @@ def update_recipe_file(path, recipe, repodir, raiseexceptions=False):
# yes, yes, I know this is all crude as hell, but it gets the job done.
# At the end of the day we are scraping the spec file, we aren't trying to build it
- pnum_re = re.compile('-p[\s]*([0-9]+)')
- configure_re = re.compile('[/%]configure\s')
+ pnum_re = re.compile(r'-p[\s]*([0-9]+)')
+ configure_re = re.compile(r'[/%]configure\s')
try:
logger.debug('Updating recipe %s' % path)
@@ -294,7 +294,7 @@ def update_recipe_file(path, recipe, repodir, raiseexceptions=False):
patchsplit = line.split()
if '-P' in line:
# Old style
- patchid = re.search('-P[\s]*([0-9]+)', line)
+ patchid = re.search(r'-P[\s]*([0-9]+)', line)
if patchid:
patchid = patchid.groups()[0]
else:
@@ -146,7 +146,7 @@ def get_recipe_pv_without_srcpv(pv, uri_type):
sfx = ''
if uri_type == 'git':
- git_regex = re.compile("(?P<pfx>(v|r|))(?P<ver>((\d+[\.\-_]*)+))(?P<sfx>(\+|)(git|)(r|)(AUTOINC|)(\+|))(?P<rev>.*)")
+ git_regex = re.compile(r"(?P<pfx>(v|r|))(?P<ver>((\d+[\.\-_]*)+))(?P<sfx>(\+|)(git|)(r|)(AUTOINC|)(\+|))(?P<rev>.*)")
m = git_regex.match(pv)
if m:
@@ -154,7 +154,7 @@ def get_recipe_pv_without_srcpv(pv, uri_type):
pfx = m.group('pfx')
sfx = m.group('sfx')
else:
- regex = re.compile("(?P<pfx>(v|r|))(?P<ver>((\w+[\.\-_]*)+))")
+ regex = re.compile(r"(?P<pfx>(v|r|))(?P<ver>((\w+[\.\-_]*)+))")
m = regex.match(pv)
if m:
pv = m.group('ver')
@@ -37,7 +37,7 @@ MAINTAINERS_INCLUDE_PATH = 'conf/distro/include/maintainers.inc'
"""
def get_recipe_maintainer(line, logger):
import re
- regex = re.compile('^RECIPE_MAINTAINER[:_]pn-(?P<pn>.*)\s=\s"(?P<name>.+) <(?P<email>.*)>"$')
+ regex = re.compile(r'^RECIPE_MAINTAINER[:_]pn-(?P<pn>.*)\s=\s"(?P<name>.+) <(?P<email>.*)>"$')
match = regex.search(line)
if match:
Fix the remaining "invalid escape sequence" warnings in the layerindex and rrs tools, which the test suite does not import. Python 3.12 turns these into SyntaxWarnings and a future release will make them errors. The resulting pattern strings are unchanged. AI-Generated: Claude Opus 5.5 Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- layerindex/tools/import_layer.py | 2 +- layerindex/tools/import_otherdistro.py | 6 +++--- rrs/tools/common.py | 4 ++-- rrs/tools/rrs_maintainer_history.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)