[pacman-dev] bash-3 only error trap activation

Andres P aepd87 at gmail.com
Tue Jun 22 01:27:38 EDT 2010


On Tue, Jun 22, 2010 at 12:30 AM, Allan McRae <allan at archlinux.org> wrote:
> I do not think that dropping 'set -E' completely is the way to go. Just
> dropping it around that pacman call is enough.
>

Another candidate for the style guide since it's obfuscated enough.

btw makepkg is also skirting around -E when it sources /etc/profile...

> This is the diff I am proposing:
>
> @@ -382,11 +382,15 @@
>  }
>
>  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
> -       pmout=$(run_pacman -T "$@")
> -       ret=$?
> +       pmout=$(run_pacman -T "$@") || ret=$?
> +       set -E
> +
>        if (( ret == 127 )); then #unresolved deps
>                echo "$pmout"
>        elif (( ret )); then
>

Let me know what repo is this diff going to so I can rebase 'undeclared local
vars' and 'do not ignore pacman errors' against it.

Andres P


More information about the pacman-dev mailing list