summaryrefslogtreecommitdiffstats
path: root/scripts/contrib/convert-overrides.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/contrib/convert-overrides.py')
-rwxr-xr-xscripts/contrib/convert-overrides.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/contrib/convert-overrides.py b/scripts/contrib/convert-overrides.py
index bfdf785719..6505b18cf0 100755
--- a/scripts/contrib/convert-overrides.py
+++ b/scripts/contrib/convert-overrides.py
@@ -68,15 +68,15 @@ packagevars = packagevars + imagevars
68 68
69vars_re = {} 69vars_re = {}
70for exp in vars: 70for exp in vars:
71 vars_re[exp] = (re.compile('((^|[\'"\s])[A-Za-z0-9_\-:${}]+)_' + exp), r"\1:" + exp) 71 vars_re[exp] = (re.compile('((^|[\'"\s\-\+])[A-Za-z0-9_\-:${}]+)_' + exp), r"\1:" + exp)
72 72
73shortvars_re = {} 73shortvars_re = {}
74for exp in shortvars: 74for exp in shortvars:
75 shortvars_re[exp] = (re.compile('((^|[\'"\s])[A-Za-z0-9_\-:${}]+)_' + exp + '([\(\'"\s:])'), r"\1:" + exp + r"\3") 75 shortvars_re[exp] = (re.compile('((^|[\'"\s\-\+])[A-Za-z0-9_\-:${}]+)_' + exp + '([\(\'"\s:])'), r"\1:" + exp + r"\3")
76 76
77package_re = {} 77package_re = {}
78for exp in packagevars: 78for exp in packagevars:
79 package_re[exp] = (re.compile('(^|[\'"\s]+)' + exp + '_' + '([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2") 79 package_re[exp] = (re.compile('(^|[\'"\s\-\+]+)' + exp + '_' + '([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2")
80 80
81# Other substitutions to make 81# Other substitutions to make
82subs = { 82subs = {
@@ -123,6 +123,10 @@ def processfile(fn):
123ourname = os.path.basename(sys.argv[0]) 123ourname = os.path.basename(sys.argv[0])
124ourversion = "0.9.1" 124ourversion = "0.9.1"
125 125
126if os.path.isfile(sys.argv[1]):
127 processfile(sys.argv[1])
128 sys.exit(0)
129
126for targetdir in sys.argv[1:]: 130for targetdir in sys.argv[1:]:
127 print("processing directory '%s'" % targetdir) 131 print("processing directory '%s'" % targetdir)
128 for root, dirs, files in os.walk(targetdir): 132 for root, dirs, files in os.walk(targetdir):