diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2018-11-28 05:00:36 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2018-12-04 08:22:27 +0100 |
commit | 9f1b735d76d04665d6324e723e163a52ca27567c (patch) | |
tree | fd58de354872e9343d90e97ba8630417ab017db7 /scripts/libmakepkg/executable/gpg.sh.in | |
parent | 65e09705d3ad781fd41cf1996f2b60e2e2c1975b (diff) | |
download | pacman-9f1b735d76d04665d6324e723e163a52ca27567c.tar.gz pacman-9f1b735d76d04665d6324e723e163a52ca27567c.tar.xz |
libmakepkg/executable: don't rely on scoped value of $ret to flag outcomes
Elsewhere, we return 1 if a library dropin fails, and when running
functions in a loop, we use `|| ret=1` to preserve scope. This ensures
the return value of the function remains useful in isolation. Do the
same thing here as well.
Drop trivial function which wraps a dropin that also uses $ret, since
it's no longer needed.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/libmakepkg/executable/gpg.sh.in')
-rw-r--r-- | scripts/libmakepkg/executable/gpg.sh.in | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/libmakepkg/executable/gpg.sh.in b/scripts/libmakepkg/executable/gpg.sh.in index c0f57013..139773ef 100644 --- a/scripts/libmakepkg/executable/gpg.sh.in +++ b/scripts/libmakepkg/executable/gpg.sh.in @@ -28,6 +28,8 @@ source "$LIBRARY/util/option.sh" executable_functions+=('executable_gpg') executable_gpg() { + local ret=0 + if [[ $SIGNPKG == 'y' ]] || { [[ -z $SIGNPKG ]] && check_buildenv "sign" "y"; }; then if ! type -p gpg >/dev/null; then error "$(gettext "Cannot find the %s binary required for signing packages.")" "gpg" @@ -41,4 +43,6 @@ executable_gpg() { ret=1 fi fi + + return $ret } |