diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2021-07-30 12:23:08 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-07-30 11:31:09 +0100 |
commit | 926fae24e1aa96454fce62b71ff2e8c95041b383 (patch) | |
tree | 40db0a07f6b49c0863efe11736eede71f35510e8 /scripts/contrib | |
parent | 812ca4cc9120ce6d0fa9c669908b9b5b5afd682c (diff) | |
download | poky-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/contrib')
-rwxr-xr-x | scripts/contrib/convert-overrides.py | 26 |
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 | |||
23 | import shutil | 23 | import shutil |
24 | import mimetypes | 24 | import mimetypes |
25 | 25 | ||
26 | if len(sys.argv) != 2: | 26 | if 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 | ||
30 | targetdir = sys.argv[1] | ||
31 | |||
32 | # List of strings to treat as overrides | 30 | # List of strings to treat as overrides |
33 | vars = ["append", "prepend", "remove"] | 31 | vars = ["append", "prepend", "remove"] |
34 | vars = vars + ["qemuarm", "qemux86", "qemumips", "qemuppc", "qemuriscv", "qemuall"] | 32 | vars = vars + ["qemuarm", "qemux86", "qemumips", "qemuppc", "qemuriscv", "qemuall"] |
@@ -125,15 +123,17 @@ def processfile(fn): | |||
125 | ourname = os.path.basename(sys.argv[0]) | 123 | ourname = os.path.basename(sys.argv[0]) |
126 | ourversion = "0.9.1" | 124 | ourversion = "0.9.1" |
127 | 125 | ||
128 | for root, dirs, files in os.walk(targetdir): | 126 | for 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 | ||
139 | print("All files processed with version %s" % ourversion) | 139 | print("All files processed with version %s" % ourversion) |