[PATCH v2 1/3] pacdiff: Implement die()
Denton Liu
liu.denton at gmail.com
Thu Mar 4 11:55:45 UTC 2021
In a future commit, we will be making more use of this function. For
now, implement it and use it in the one place where it's applicable.
Signed-off-by: Denton Liu <liu.denton at gmail.com>
---
src/pacdiff.sh.in | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/pacdiff.sh.in b/src/pacdiff.sh.in
index c4dbd89..46a5adf 100644
--- a/src/pacdiff.sh.in
+++ b/src/pacdiff.sh.in
@@ -34,6 +34,11 @@ declare -i USE_FIND=0 USE_LOCATE=0 USE_PACDB=0 OUTPUTONLY=0
# Import libmakepkg
source "$LIBRARY"/util/message.sh
+die() {
+ error "$@"
+ exit 1
+}
+
usage() {
cat <<EOF
${myname} v${myver}
@@ -127,8 +132,7 @@ else
fi
if ! type -p ${diffprog%% *} >/dev/null && (( ! OUTPUTONLY )); then
- error "Cannot find the $diffprog binary required for viewing differences."
- exit 1
+ die "Cannot find the $diffprog binary required for viewing differences."
fi
case $(( USE_FIND + USE_LOCATE + USE_PACDB )) in
--
2.31.0.rc1.228.gb75b4e4ce2
More information about the pacman-contrib
mailing list