# HG changeset patch # User Franz Glasner # Date 1727803737 -7200 # Node ID 44a702b32c019c18866bf694f2d59db7a4901200 # Parent 5931f16f098fdef5cda01de60a04f191c330d2c9 fpkg: include common.subr and use modernized error reporting diff -r 5931f16f098f -r 44a702b32c01 sbin/fpkg --- a/sbin/fpkg Tue Oct 01 19:01:37 2024 +0200 +++ b/sbin/fpkg Tue Oct 01 19:28:57 2024 +0200 @@ -103,6 +103,12 @@ as the host'"'"'s. ' + +_p_datadir='@@DATADIR@@' +[ "${_p_datadir#@@DATADIR}" = '@@' ] && _p_datadir="$(dirname "$0")"/../share/local-bsdtools +. "${_p_datadir}/common.subr" + + #: #: Configuration directory #: @@ -387,8 +393,7 @@ exit 2; ;; *) - echo "ERROR: option handling failed" >&2 - exit 2 + fatal 2 "option handling failed" ;; esac done @@ -403,7 +408,7 @@ command="$1" shift -test -n "$command" || { echo "ERROR: no command given" >&2; exit 2; } +test -n "$command" || fatal 2 "no command given" case "${command}" in audit) @@ -434,7 +439,6 @@ command_vv "$@" ;; *) - echo "ERROR: unknown command \`${command}'" >&2 - exit 2; + fatal 2 "unknown command \`${command}'" ;; esac