convert-overrides.py: 0.9.1 include '(' as delimiter for shortvars
PATCH 1/2 convert-overrides.py: 0.9.1 include '(' as delimiter for shortvars
Signed-off-by Martin Jansa <[email protected]>
--- scripts/contrib/convert-overrides.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/contrib/convert-overrides.py +2 -2
@@ -74,7 +74,7 @@ for exp in vars: shortvars_re = {} for exp in shortvars: - shortvars_re[exp] = (re.compile('((^|[\'"\s])[A-Za-z0-9_\-:${}]+)_' + exp + '([\'"\s:])'), r"\1:" + exp + r"\3") + shortvars_re[exp] = (re.compile('((^|[\'"\s])[A-Za-z0-9_\-:${}]+)_' + exp + '([\(\'"\s:])'), r"\1:" + exp + r"\3") package_re = {} for exp in packagevars:
@@ -123,7 +123,7 @@ def processfile(fn): pass ourname = os.path.basename(sys.argv[0]) -ourversion = "0.9.0" +ourversion = "0.9.1" for root, dirs, files in os.walk(targetdir): for name in files:
Signature · 1 line
2.30.2
PATCH 2/2 convert-overrides.py: allow specifying multiple target dirs
Signed-off-by Martin Jansa <[email protected]>
--- scripts/contrib/convert-overrides.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
scripts/contrib/convert-overrides.py +13 -13
@@ -23,12 +23,10 @@ import tempfile import shutil import mimetypes -if len(sys.argv) != 2: +if len(sys.argv) < 2: print("Please specify a directory to run the conversion script against.") sys.exit(1) -targetdir = sys.argv[1] - # List of strings to treat as overrides vars = ["append", "prepend", "remove"] vars = vars + ["qemuarm", "qemux86", "qemumips", "qemuppc", "qemuriscv", "qemuall"]
@@ -125,15 +123,17 @@ def processfile(fn): ourname = os.path.basename(sys.argv[0]) ourversion = "0.9.1" -for root, dirs, files in os.walk(targetdir): - for name in files: - if name == ourname: - continue - fn = os.path.join(root, name) - if os.path.islink(fn): - continue - if "/.git/" in fn or fn.endswith(".html") or fn.endswith(".patch") or fn.endswith(".m4") or fn.endswith(".diff"): - continue - processfile(fn) +for targetdir in sys.argv[1:]: + print("processing directory '%s'" % targetdir) + for root, dirs, files in os.walk(targetdir): + for name in files: + if name == ourname: + continue + fn = os.path.join(root, name) + if os.path.islink(fn): + continue + if "/.git/" in fn or fn.endswith(".html") or fn.endswith(".patch") or fn.endswith(".m4") or fn.endswith(".diff"): + continue + processfile(fn) print("All files processed with version %s" % ourversion)
Signature · 1 line
2.30.2