2023-04-04 09:59:25 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
# vim: ft=python
|
|
|
|
|
# -*- mode: python -*-
|
|
|
|
|
|
2023-04-04 10:59:42 +01:00
|
|
|
import glob
|
|
|
|
|
import os
|
|
|
|
|
from kexttool import kext
|
|
|
|
|
|
|
|
|
|
cwd = os.getcwd()
|
2023-04-04 11:01:04 +01:00
|
|
|
scan_arg = os.path.join(cwd, 'extensions', '**/extension.yaml')
|
2023-04-04 10:59:42 +01:00
|
|
|
|
|
|
|
|
nr_extensions = 0
|
|
|
|
|
|
|
|
|
|
# root_dir needs a trailing slash (i.e. /root/dir/)
|
|
|
|
|
for filename in glob.iglob(scan_arg, recursive=True):
|
|
|
|
|
try:
|
|
|
|
|
kext_src = kext.KextSource(filename)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print('E: cannot read kernel extension source manifest (reason: {})'.format(e))
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
print('* {}'.format(kext_src.name()))
|
|
|
|
|
print(' Bundle ID: {}'.format(kext_src.id()))
|
|
|
|
|
print(' License: {}'.format(kext_src.license()))
|
|
|
|
|
print(' Copyright: {}'.format(kext_src.copyright()))
|
|
|
|
|
print(' Location: {}'.format(kext_src.src_dirpath()))
|
|
|
|
|
print(' Sources:')
|
|
|
|
|
|
|
|
|
|
for src in kext_src.sources():
|
|
|
|
|
print(' {}'.format(src))
|
|
|
|
|
|
|
|
|
|
nr_extensions = nr_extensions + 1
|