diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-25 17:24:14 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-25 17:28:30 -0400 |
commit | 7d85e2d931cc2fb063d1360527fce5d5384fa6b5 (patch) | |
tree | 3f7bdffd4575f7d878469b59476df8d378d1d805 /src | |
parent | 525bb0c472f103fa30fe83a2de7c8c7e0469d8b8 (diff) |
move more things to use the $EXIT_* variables
Diffstat (limited to 'src')
-rwxr-xr-x | src/abslibre-tools/librerelease | 20 | ||||
-rwxr-xr-x | src/aur | 6 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 0009336..abf86dd 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -138,7 +138,7 @@ usage() { main() { if [[ -w / ]]; then error "This program should be run as regular user" - return 1 + return $EXIT_NOPERMISSION fi # Parse options @@ -150,18 +150,18 @@ main() { u) upload_only=true ;; n) dryrun="--dry-run" ;; h) mode=usage ;; - *) usage >&2; return 1 ;; + *) usage >&2; return $EXIT_INVALIDARGUMENT ;; esac done shift $((OPTIND - 1)) if [[ $# != 0 ]]; then usage >&2 - return 1 + return $EXIT_INVALIDARGUMENT fi if [[ $mode == usage ]]; then usage - return 0 + return $EXIT_SUCCESS fi declare -i ret=0 @@ -198,14 +198,14 @@ main() { if ! $REPODEST_ok; then error 'The format of libretools.conf:REPODEST has changed.' plain 'Merge the /etc/libretools.conf.pacnew file!' - return 6 + return $EXIT_NOTCONFIGURED fi if [[ "$REPODEST_path" = '/~'* ]]; then if [[ "$REPODEST_path" = '/~/'* ]]; then REPODEST_path=${REPODEST_path#'/~/'} else error 'Unfortunately, `~user` home-directory expansion is not (yet?) supported in libretools.conf:REPODEST' - return 6 + return $EXIT_NOTCONFIGURED fi fi if [[ "$REPODEST_host" = '['*']' ]]; then @@ -252,7 +252,7 @@ release_packages() { lock 8 "${WORKDIR}/staging.lock" \ 'Waiting for an exclusive lock on the staging directory' - sign_packages || return 1 + sign_packages || return # Make the permissions of the packages 644 otherwise the user will get access # denied error when they try to download (rsync --no-perms doesn't seem to @@ -276,13 +276,13 @@ release_packages() { "$REPODEST_userhost:$REPODEST_path/" then error "Sync failed, try again" - return 1 + return $EXIT_FAILURE fi clean_files "$file_list" if $upload_only; then - return 0 + return $EXIT_SUCCESS fi msg "Running db-update on repos" @@ -294,7 +294,7 @@ release_packages() { bash -c "${HOOKPOSTRELEASE}" fi - return 0 + return $EXIT_SUCCESS } main "$@" @@ -36,13 +36,13 @@ usage() { main() { while getopts 'h' arg; do case $arg in - h) usage; return 0;; - *) usage >&2; return 1;; + h) usage; return $EXIT_SUCCESS;; + *) usage >&2; return $EXIT_INVALIDARGUMENT;; esac done if [[ $# -lt 1 ]]; then usage >&2 - return 1 + return $EXIT_INVALIDARGUMENT fi . "$(librelib conf)" |