diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-15 22:05:37 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-15 22:05:37 -0400 |
commit | 3771f34a54bca198921d60a1bce83068b7bd4f49 (patch) | |
tree | 0e2fc0ba05f377ef12cdcf4c78644dcbfb0d0ee9 | |
parent | 56472f6c28e278fb937e3456f91b52cc5ec0b143 (diff) |
librefetch: The ERR trap is greedy; use exit instead of return from main().
-rwxr-xr-x | src/librefetch/librefetch | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 98d85a2..8fd8c1d 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -86,7 +86,7 @@ main() { if [[ $mode =~ help ]]; then usage - return 0 + exit 0 fi ######################################################################## @@ -97,7 +97,7 @@ main() { if [[ $mode =~ makepkg ]]; then cat "$makepkg" - return 0 + exit 0 fi ######################################################################## @@ -123,14 +123,14 @@ main() { PKGBUILD) sed -e 's/^[a-z]/mk&/' -e 's/^\s/ &/';; SRCBUILD) cat;; esac - return 0 + exit 0 fi # Mode: srcbuild ####################################################### if [[ $mode =~ srcbuild ]]; then cat "$srcbuild" - return 0 + exit 0 fi ######################################################################## @@ -148,7 +148,7 @@ main() { if [[ $mode =~ download ]]; then load_files librefetch - check_vars librefetch MIRRORS DOWNLOADER || return 1 + check_vars librefetch MIRRORS DOWNLOADER || exit 1 # Canonicalize $src if [[ "$src" == libre://* ]]; then @@ -174,7 +174,7 @@ main() { dlcmd="${dlcmd//\%o/\"\$dst\"}" dlcmd="${dlcmd//\%u/\"\$src\"}" - { eval "$dlcmd"; } >&2 && return 0 + { eval "$dlcmd"; } >&2 && exit 0 fi # Mode: create ######################################################### @@ -186,7 +186,7 @@ main() { export pkg_file=$dst cd "$BUILDFILEDIR" - "$makepkg" "${makepkg_opts[@]}" -p "$srcbuild" >&2 || return $? + "$makepkg" "${makepkg_opts[@]}" -p "$srcbuild" >&2 || exit $? fi } |