]> git.proxmox.com Git - pve-edk2-firmware.git/blobdiff - debian/find-binaries.py
update submodule, patches and buildsys to 2023.08
[pve-edk2-firmware.git] / debian / find-binaries.py
index b3f3ddecf8e214dfb06b597be4b737dcb2b689cc..b5774394791774abd1433ade7c57f3ca1d6235b6 100644 (file)
@@ -2,9 +2,10 @@
 
 # Use heuristics to identify new files that maybe binaries.
 # Flagged files need to be manually inspected and either added to the
-# allow list (because they are safe to redistribute), or to the reject list
+# ignore list (because they are safe to redistribute), or to the reject list
 # (so that they'll be removed prior to orig.tar.xz generation).
 
+import glob
 import os
 import re
 import sys
@@ -41,15 +42,26 @@ def extensionOK(name):
 
 
 if __name__ == '__main__':
+    ret = 0
     top = './'
-    for root, dirs, files in os.walk(top):
-        with open('./debian/binary-check.allow', 'r') as f:
-            allowlist = list(map(lambda s: s.strip(), f.readlines()))
 
-        ret = 0
+    ignorelist = []
+    with open('./debian/binary-check.ignore', 'r') as f:
+        ignoreglobs = list(map(lambda s: s.strip(), f.readlines()))
+    for pattern in ignoreglobs:
+        matches = glob.glob(pattern, recursive=True, include_hidden=True)
+        if len(matches) == 0:
+            print(
+                f"WARNING: pattern {pattern} matched no files.",
+                file=sys.stderr,
+            )
+        ignorelist += matches
+
+    for root, dirs, files in os.walk(top):
         for name in files:
             relpath = os.path.join(root, name)[len(top):]
-            if relpath in allowlist:
+            if relpath in ignorelist:
+                print(f"Ignoring: {relpath}", file=sys.stderr)
                 continue
             if nameOK(name):
                 continue