diff options
author | Andrei Pavel <andrei@isc.org> | 2024-03-21 15:34:17 +0100 |
---|---|---|
committer | Andrei Pavel <andrei@isc.org> | 2024-03-21 17:00:16 +0100 |
commit | 30432f7e8b042d0792a5ef4f0a6619186b57e4da (patch) | |
tree | 2d72342133ed1f2d0e38a11486367eb686739bf9 /tools | |
parent | [#3267] add tools/find-uninstalled-headers.py (diff) | |
download | kea-30432f7e8b042d0792a5ef4f0a6619186b57e4da.tar.xz kea-30432f7e8b042d0792a5ef4f0a6619186b57e4da.zip |
[#3267] cosmetic changes to find headers script
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/find-uninstalled-headers.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/find-uninstalled-headers.py b/tools/find-uninstalled-headers.py index f09ea713f8..5963af6e57 100755 --- a/tools/find-uninstalled-headers.py +++ b/tools/find-uninstalled-headers.py @@ -1,19 +1,22 @@ #!/usr/bin/env python3 """ -This script checks that all source headers are installed by inspecting Makefile.am files. +This script checks that all source headers are installed by inspecting +Makefile.am files. -Usage: ./find-uninstalled-headers.py +Usage: ./tools/find-uninstalled-headers.py """ import pathlib import re +import sys + def main(): makefile_ams = sorted(pathlib.Path('./src/lib').glob('**/Makefile.am')) headers = sorted(pathlib.Path('./src/lib').glob('**/*.h')) - headers_pattern = re.compile(r'_HEADERS [\+]{0,1}= (.*\.h|)(.*)') + headers_pattern = re.compile(r'_HEADERS [+]?= (.*\.h|)(.*)') backslash_pattern = re.compile(r'(.*\.h) \\$') failure = False @@ -57,13 +60,15 @@ def main(): for header in headers: if not any(i in header.parts for i in ['tests', 'testutils', 'unittests']): if first: - print('The following headers are not in the _HEADERS section of their respective Makefile.am file:') + print('The following headers are not in the _HEADERS section of ' + 'their respective Makefile.am file:') first = False print(f'- {header}') failure = True if failure: - exit(1) + sys.exit(1) + if __name__ == '__main__': main() |