]>
git.proxmox.com Git - mirror_linux-firmware.git/blob - check_whence.py
6 with
open('WHENCE') as whence
:
8 match
= re
.match(r
'(?:File|Link|Source):\s*(\S*)', line
)
12 match
= re
.match(r
'Licen[cs]e: (?:.*\bSee (.*) for details\.?|(\S*))\n',
16 for name
in re
.split(r
', | and ', match
.group(1)):
20 # Just one word - may or may not be a filename
21 if not re
.search(r
'unknown|distributable', match
.group(2),
27 with os
.popen('git ls-files') as git_files
:
28 for line
in git_files
:
29 yield line
.rstrip('\n')
32 whence_list
= list(list_whence())
33 known_files
= set(name
for name
in whence_list
if not name
.endswith('/')) | \
34 set(['check_whence.py', 'configure', 'Makefile',
36 known_prefixes
= set(name
for name
in whence_list
if name
.endswith('/'))
37 git_files
= set(list_git())
39 for name
in sorted(list(known_files
- git_files
)):
40 sys
.stderr
.write('E: %s listed in WHENCE does not exist\n' % name
)
42 for name
in sorted(list(git_files
- known_files
)):
43 # Ignore subdirectory changelogs and GPG detached signatures
44 if (name
.endswith('/ChangeLog') or
45 (name
.endswith('.asc') and name
[:-4] in known_files
)):
48 # Ignore unknown files in known directories
49 for prefix
in known_prefixes
:
50 if name
.startswith(prefix
):
53 sys
.stderr
.write('E: %s not listed in WHENCE\n' % name
)
55 if __name__
== '__main__':