summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2021-07-30 12:23:08 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-30 11:31:09 +0100
commit926fae24e1aa96454fce62b71ff2e8c95041b383 (patch)
tree40db0a07f6b49c0863efe11736eede71f35510e8 /scripts
parent812ca4cc9120ce6d0fa9c669908b9b5b5afd682c (diff)
downloadpoky-926fae24e1aa96454fce62b71ff2e8c95041b383.tar.gz
convert-overrides.py: allow specifying multiple target dirs
(From OE-Core rev: e6aa4b1f6f4f174cba027ee096db174541815ff0) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/contrib/convert-overrides.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/scripts/contrib/convert-overrides.py b/scripts/contrib/convert-overrides.py
index 739fd53bdb..bfdf785719 100755
--- a/scripts/contrib/convert-overrides.py
+++ b/scripts/contrib/convert-overrides.py
@@ -23,12 +23,10 @@ import tempfile
23import shutil 23import shutil
24import mimetypes 24import mimetypes
25 25
26if len(sys.argv) != 2: 26if len(sys.argv) < 2:
27 print("Please specify a directory to run the conversion script against.") 27 print("Please specify a directory to run the conversion script against.")
28 sys.exit(1) 28 sys.exit(1)
29 29
30targetdir = sys.argv[1]
31
32# List of strings to treat as overrides 30# List of strings to treat as overrides
33vars = ["append", "prepend", "remove"] 31vars = ["append", "prepend", "remove"]
34vars = vars + ["qemuarm", "qemux86", "qemumips", "qemuppc", "qemuriscv", "qemuall"] 32vars = vars + ["qemuarm", "qemux86", "qemumips", "qemuppc", "qemuriscv", "qemuall"]
@@ -125,15 +123,17 @@ def processfile(fn):
125ourname = os.path.basename(sys.argv[0]) 123ourname = os.path.basename(sys.argv[0])
126ourversion = "0.9.1" 124ourversion = "0.9.1"
127 125
128for root, dirs, files in os.walk(targetdir): 126for targetdir in sys.argv[1:]:
129 for name in files: 127 print("processing directory '%s'" % targetdir)
130 if name == ourname: 128 for root, dirs, files in os.walk(targetdir):
131 continue 129 for name in files:
132 fn = os.path.join(root, name) 130 if name == ourname:
133 if os.path.islink(fn): 131 continue
134 continue 132 fn = os.path.join(root, name)
135 if "/.git/" in fn or fn.endswith(".html") or fn.endswith(".patch") or fn.endswith(".m4") or fn.endswith(".diff"): 133 if os.path.islink(fn):
136 continue 134 continue
137 processfile(fn) 135 if "/.git/" in fn or fn.endswith(".html") or fn.endswith(".patch") or fn.endswith(".m4") or fn.endswith(".diff"):
136 continue
137 processfile(fn)
138 138
139print("All files processed with version %s" % ourversion) 139print("All files processed with version %s" % ourversion)