]> git.ipfire.org Git - thirdparty/util-linux.git/commit
tools: rewrite checkcompletion.sh to be source-based
authorKarel Zak <kzak@redhat.com>
Thu, 2 Oct 2025 12:07:53 +0000 (14:07 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 3 Oct 2025 11:25:10 +0000 (13:25 +0200)
commit31ffdd82b20303c920c1bd32be0ea5e95734d6a8
tree2fbea4fb8aa4e661751487061c17b1a0425b789d
parenteb0e08a76e3ebd4571b957e727847060304c32bb
tools: rewrite checkcompletion.sh to be source-based

The original checkcompletion.sh checked compiled binaries in the build
directory, which was unreliable and build-dependent. The new version
performs comprehensive source-based verification by:

1. Extracting program names from */Makemodule.am files (bin_PROGRAMS,
   sbin_PROGRAMS, usrbin_exec_PROGRAMS, usrsbin_exec_PROGRAMS)

2. Verifying three-way consistency:
   - Programs defined in Makemodule.am files
   - bash-completion files in bash-completion/ directory
   - Entries in bash-completion/Makemodule.am
   - Entries in meson.build

3. Properly handling special cases:
   - Programs that don't need completion (system tools like login, agetty)
   - Programs with special install hooks (runuser, lastb symlinks)

The script now provides clear categorized output:
- Programs missing bash-completion files
- bash-completion files not registered in Makemodule.am
- Orphaned bash-completion files without programs

This makes it easier to maintain bash-completion consistency and catch
issues before release.

Signed-off-by: Karel Zak <kzak@redhat.com>
tools/checkcompletion.sh