]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3267] cosmetic changes to find headers script
authorAndrei Pavel <andrei@isc.org>
Thu, 21 Mar 2024 14:34:17 +0000 (16:34 +0200)
committerAndrei Pavel <andrei@isc.org>
Thu, 21 Mar 2024 16:00:16 +0000 (18:00 +0200)
tools/find-uninstalled-headers.py

index f09ea713f8cadd38b76a16eb5fdcd0b83f19dfc5..5963af6e5718b0410419db6a698f3d237a93d491 100755 (executable)
@@ -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()