diff options
Diffstat (limited to 'scripts/contrib/convert-overrides.py')
-rwxr-xr-x | scripts/contrib/convert-overrides.py | 10 |
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 | ||
69 | vars_re = {} | 69 | vars_re = {} |
70 | for exp in vars: | 70 | for 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 | ||
73 | shortvars_re = {} | 73 | shortvars_re = {} |
74 | for exp in shortvars: | 74 | for 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 | ||
77 | package_re = {} | 77 | package_re = {} |
78 | for exp in packagevars: | 78 | for 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 |
82 | subs = { | 82 | subs = { |
@@ -123,6 +123,10 @@ def processfile(fn): | |||
123 | ourname = os.path.basename(sys.argv[0]) | 123 | ourname = os.path.basename(sys.argv[0]) |
124 | ourversion = "0.9.1" | 124 | ourversion = "0.9.1" |
125 | 125 | ||
126 | if os.path.isfile(sys.argv[1]): | ||
127 | processfile(sys.argv[1]) | ||
128 | sys.exit(0) | ||
129 | |||
126 | for targetdir in sys.argv[1:]: | 130 | for 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): |