]>
git.proxmox.com Git - pve-edk2-firmware.git/blob - debian/find-binaries.py
3 # Use heuristics to identify new files that maybe binaries.
4 # Flagged files need to be manually inspected and either added to the
5 # allow list (because they are safe to redistribute), or to the reject list
6 # (so that they'll be removed prior to orig.tar.xz generation).
14 OKPatterns
= [r
'\.gitignore', r
'AUTHORS', r
'FILE.LST', r
'Change[lL]og',
15 r
'COPYING', r
'configure', r
'FAQ', r
'(GNU)?[Mm]akefile',
16 r
'INDEX', r
'LICENSE', r
'README', r
'TODO']
17 OKRegexs
= map(re
.compile, OKPatterns
)
25 def extensionOK(name
):
26 OKExtensions
= ['1', '3', 'ASL', 'asi', 'asl', 'aslc', 'Asm', 'asm',
27 'asm16', 'bat', 'bmp', 'c', 'CMM', 'cmm', 'cnf', 'cpp',
28 'css', 'dec', 'decTest', 'dlg', 'dsc', 'docx', 'dsp',
29 'dsw', 'el', 'env', 'fdf', 'g', 'gif', 'H', 'h', 'hpp',
30 'html', 'i', 'idf', 'in', 'inc', 'inf', 'info', 'ini',
31 'lds', 'log', 'lua', 'mak', 'makefile', 'md', 'nasm',
32 'nasmb', 'nsh', 'patch', 'pbxuser', 'pbxproj', 'pdf',
33 'pem', 'pl', 'png', 'pod', 'ps', 'py', 'r', 'rtf', 'S',
34 's', 'sct', 'sh', 'sln', 't', 'template', 'txt', 'uni',
35 'Vfr', 'vcproj', 'vfi', 'vfr', 'xml']
36 ext
= name
.split('.')[-1]
38 if ext
in OKExtensions
:
43 if __name__
== '__main__':
45 for root
, dirs
, files
in os
.walk(top
):
46 with
open('./debian/binary-check.allow', 'r') as f
:
47 allowlist
= list(map(lambda s
: s
.strip(), f
.readlines()))
51 relpath
= os
.path
.join(root
, name
)[len(top
):]
52 if relpath
in allowlist
:
60 "WARNING: Possible binary %s\n" %
61 (os
.path
.join(root
, name
))