From 3a18b5e8cf50b688f3c6e0ffbaaa1c70cf09f484 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 20 Apr 2017 23:24:27 -0400 Subject: Use "$?" more sparingly. --- src/librefetch/librefetch | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/librefetch') diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 855719d..bba7df9 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -213,9 +213,9 @@ doit() { if [[ $base_dst == *.sig ]]; then if ! [[ -e $base_dst ]]; then extra_opts=("${src%.sig}" "${base_dst%.sig}") - doit || exit $? + doit || exit fi - create_signature "${base_dst%.sig}" || exit $? + create_signature "${base_dst%.sig}" || exit if [[ -n $suffix ]]; then mv -f "$base_dst" "$dst" fi @@ -225,7 +225,7 @@ doit() { export pkg_file=$dst cd "$BUILDFILEDIR" - "$makepkg" "${makepkg_opts[@]}" -p "$srcbuild" >&2 || exit $? + "$makepkg" "${makepkg_opts[@]}" -p "$srcbuild" >&2 || exit fi fi } @@ -252,8 +252,7 @@ parse_options() { # Feed the options through getopt (sanitize them) local shrt="$({ printf '%s\0' "${shrt1[@]}"; printf '%s:\0' "${shrt2[@]}"; } | sort -zu | xargs -0 printf '%s')" local long="$({ printf '%s\0' "${long1[@]}"; printf '%s:\0' "${long2[@]}"; } | sort -zu | xargs -0 printf '%s,')" - local args="$(getopt -n "$cmd" -o "$shrt" -l "${long%,}" -- "$@")" - ret=$? + local args="$(getopt -n "$cmd" -o "$shrt" -l "${long%,}" -- "$@")" || ret=$? eval set -- "$args" unset shrt long args -- cgit v1.2.3-54-g00ecf