summaryrefslogtreecommitdiff
path: root/src/chroot-tools/libremakepkg
diff options
context:
space:
mode:
Diffstat (limited to 'src/chroot-tools/libremakepkg')
-rwxr-xr-xsrc/chroot-tools/libremakepkg16
1 files changed, 8 insertions, 8 deletions
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