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.