From 6092b9d93df1c3d5170a2b6aa0275aebef18bd37 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 25 May 2017 14:39:05 -0400 Subject: start moving things to use the libremessages exit codes --- src/chroot-tools/libremakepkg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/chroot-tools/libremakepkg') diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 02b31a8..841f533 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -83,9 +83,9 @@ run_hook() { if [[ ${#fails[@]} -gt 0 ]]; then error "Failure(s) in %s: %s" "$hookname" "${fails[*]}" - return 1 + return $EXIT_FAILURE else - return 0 + return $EXIT_SUCCESS fi } @@ -176,7 +176,7 @@ usage() { err_chflag() { local flag=$1 error 'The -%s flag does not make sense inside of a chroot' "$flag" - return 1 + exit $EXIT_INVALIDARGUMENT } main() { @@ -197,14 +197,14 @@ main() { librechroot_flags+=(-$flag "$OPTARG"); fi;; N) NONET=false;; R) repack=true; makepkg_args+=(-R);; - h) usage; return 0;; - *) usage >&2; return 1;; + h) usage; exit $EXIT_SUCCESS;; + *) usage >&2; exit $EXIT_INVALIDARGUMENT;; esac done shift $((OPTIND - 1)) if [[ $# != 0 ]]; then error 'Extra arguments: %s' "$*" - return 1 + exit $EXIT_INVALIDARGUMENT fi # Resolve the chroot path ############################################## @@ -236,13 +236,13 @@ main() { if (( EUID )); then error "This program must be run as root" - exit 1 + exit $EXIT_NOPERMISSION fi if [[ ! -f PKGBUILD ]]; then # This is the message used by makepkg error "PKGBUILD does not exist." - exit 1 + exit $EXIT_FAILURE fi # Make sure that the various *DEST directories exist -- cgit v1.2.2