Fix rpm-ostree compatibility and postinst script issues

- Add --version and --help flags for rpm-ostree compatibility
- Fix postinst script to handle 'triggered' argument properly
- Maintain subcommand interface while adding flag support
- Improve error messages and help text
This commit is contained in:
robojerk 2025-08-15 18:18:40 -07:00
parent 86b2c1b4ea
commit 5fe7b0a519
3 changed files with 125 additions and 25 deletions

View file

@ -127,6 +127,23 @@ EOF
echo "Aborting $PACKAGE configuration..."
;;
triggered)
# Handle trigger activation (e.g., man page updates, shell completion)
echo "Handling $PACKAGE triggers..."
# Update shell completion caches
if command -v update-bash-completion >/dev/null 2>&1; then
update-bash-completion apt-ostree || true
fi
# Update man page database
if command -v mandb >/dev/null 2>&1; then
mandb -q || true
fi
echo "$PACKAGE triggers handled successfully"
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1