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