mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
makepkg: prevent error trap activation in bash-3.2
Running "pacman -T foo" is expected to return a non-zero value when "foo" is not installed. This sets of the error trap in bash-3.2 but not bash 4.x. Work around this by disabling the error trap around this pacman call as we are manually checking the return value anyway. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
708f186f98
commit
07a9effdd0
@ -382,11 +382,15 @@ run_pacman() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_deps() {
|
check_deps() {
|
||||||
(( $# > 0 )) || return
|
(( $# > 0 )) || return 0
|
||||||
|
|
||||||
|
# Disable error trap in pacman subshell call as this breaks bash-3.2 compatibility
|
||||||
|
# Also, a non-zero return value is not unexpected and we are manually dealing them
|
||||||
|
set +E
|
||||||
local ret=0
|
local ret=0
|
||||||
pmout=$(run_pacman -T "$@")
|
pmout=$(run_pacman -T "$@") || ret=$?
|
||||||
ret=$?
|
set -E
|
||||||
|
|
||||||
if (( ret == 127 )); then #unresolved deps
|
if (( ret == 127 )); then #unresolved deps
|
||||||
echo "$pmout"
|
echo "$pmout"
|
||||||
elif (( ret )); then
|
elif (( ret )); then
|
||||||
|
Loading…
Reference in New Issue
Block a user