diff options
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-x | scripts/contrib/bbvars.py | 6 | ||||
-rwxr-xr-x | scripts/contrib/convert-overrides.py | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/scripts/contrib/bbvars.py b/scripts/contrib/bbvars.py index 090133600b..a9cdf082ab 100755 --- a/scripts/contrib/bbvars.py +++ b/scripts/contrib/bbvars.py | |||
@@ -36,8 +36,8 @@ def bbvar_is_documented(var, documented_vars): | |||
36 | def collect_documented_vars(docfiles): | 36 | def collect_documented_vars(docfiles): |
37 | ''' Walk the docfiles and collect the documented variables ''' | 37 | ''' Walk the docfiles and collect the documented variables ''' |
38 | documented_vars = [] | 38 | documented_vars = [] |
39 | prog = re.compile(".*($|[^A-Z_])<glossentry id=\'var-") | 39 | prog = re.compile(r".*($|[^A-Z_])<glossentry id=\'var-") |
40 | var_prog = re.compile('<glossentry id=\'var-(.*)\'>') | 40 | var_prog = re.compile(r'<glossentry id=\'var-(.*)\'>') |
41 | for d in docfiles: | 41 | for d in docfiles: |
42 | with open(d) as f: | 42 | with open(d) as f: |
43 | documented_vars += var_prog.findall(f.read()) | 43 | documented_vars += var_prog.findall(f.read()) |
@@ -45,7 +45,7 @@ def collect_documented_vars(docfiles): | |||
45 | return documented_vars | 45 | return documented_vars |
46 | 46 | ||
47 | def bbvar_doctag(var, docconf): | 47 | def bbvar_doctag(var, docconf): |
48 | prog = re.compile('^%s\[doc\] *= *"(.*)"' % (var)) | 48 | prog = re.compile(r'^%s\[doc\] *= *"(.*)"' % (var)) |
49 | if docconf == "": | 49 | if docconf == "": |
50 | return "?" | 50 | return "?" |
51 | 51 | ||
diff --git a/scripts/contrib/convert-overrides.py b/scripts/contrib/convert-overrides.py index 1939757f1b..c69acb4095 100755 --- a/scripts/contrib/convert-overrides.py +++ b/scripts/contrib/convert-overrides.py | |||
@@ -81,19 +81,19 @@ skip_ext = [".html", ".patch", ".m4", ".diff"] + args.skip_ext | |||
81 | 81 | ||
82 | vars_re = {} | 82 | vars_re = {} |
83 | for exp in vars: | 83 | for exp in vars: |
84 | vars_re[exp] = (re.compile('((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp), r"\1:" + exp) | 84 | vars_re[exp] = (re.compile(r'((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp), r"\1:" + exp) |
85 | 85 | ||
86 | shortvars_re = {} | 86 | shortvars_re = {} |
87 | for exp in shortvars: | 87 | for exp in shortvars: |
88 | shortvars_re[exp] = (re.compile('((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp + '([\(\'"\s:])'), r"\1:" + exp + r"\3") | 88 | shortvars_re[exp] = (re.compile(r'((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp + r'([\(\'"\s:])'), r"\1:" + exp + r"\3") |
89 | 89 | ||
90 | package_re = {} | 90 | package_re = {} |
91 | for exp in packagevars: | 91 | for exp in packagevars: |
92 | package_re[exp] = (re.compile('(^|[#\'"\s\-\+]+)' + exp + '_' + '([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2") | 92 | package_re[exp] = (re.compile(r'(^|[#\'"\s\-\+]+)' + exp + r'_' + r'([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2") |
93 | 93 | ||
94 | # Other substitutions to make | 94 | # Other substitutions to make |
95 | subs = { | 95 | subs = { |
96 | 'r = re.compile("([^:]+):\s*(.*)")' : 'r = re.compile("(^.+?):\s+(.*)")', | 96 | 'r = re.compile(r"([^:]+):\s*(.*)")' : 'r = re.compile(r"(^.+?):\s+(.*)")', |
97 | "val = d.getVar('%s_%s' % (var, pkg))" : "val = d.getVar('%s:%s' % (var, pkg))", | 97 | "val = d.getVar('%s_%s' % (var, pkg))" : "val = d.getVar('%s:%s' % (var, pkg))", |
98 | "f.write('%s_%s: %s\\n' % (var, pkg, encode(val)))" : "f.write('%s:%s: %s\\n' % (var, pkg, encode(val)))", | 98 | "f.write('%s_%s: %s\\n' % (var, pkg, encode(val)))" : "f.write('%s:%s: %s\\n' % (var, pkg, encode(val)))", |
99 | "d.getVar('%s_%s' % (scriptlet_name, pkg))" : "d.getVar('%s:%s' % (scriptlet_name, pkg))", | 99 | "d.getVar('%s_%s' % (scriptlet_name, pkg))" : "d.getVar('%s:%s' % (scriptlet_name, pkg))", |