]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
convert-overrides.py: allow specifying multiple target dirs
authorMartin Jansa <Martin.Jansa@gmail.com>
Fri, 30 Jul 2021 10:23:08 +0000 (12:23 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Jul 2021 10:31:06 +0000 (11:31 +0100)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/convert-overrides.py

index 739fd53bdb3179c15742ce0d61e084ab3558c3c6..bfdf785719fe58ad7870d1686ab31f37e7b37719 100755 (executable)
@@ -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)