[pacman-dev] [PATCH] [makepkg] use double brackets
Allan McRae
allan at archlinux.org
Sat May 22 02:48:30 EDT 2010
On 22/05/10 15:26, Allan McRae wrote:
> On 22/05/10 15:06, Andres P wrote:
>> @@ -1810,9 +1810,9 @@ fi
>> if [[ $(! type -t build) = "function" ]]; then
>> BUILDFUNC=1
>> fi
>> -if [ "$(type -t package)" = "function" ]; then
>> +if [[ $(type -t package) = "function" ]]; then
>> PKGFUNC=1
>> -elif [ $SPLITPKG -eq 0 -a "$(type -t package_${pkgname})" =
>> "function" ]; then
>> +elif [[ $SPLITPKG -eq 0&& $(type -t package_${pkgname}) = "function"
>> ]]; then
>> SPLITPKG=1
>> fi
>
> Note that line at the top there has an "!" in the type statement. That
> is needed for bash-4.0 compatibility. This comment is just above it:
>
> # test for available PKGBUILD functions
> # The exclamation mark is required here to avoid triggering the ERR trap
> when
> # a tested function does not exist.
>
> I'm not sure we can break bash-4.0 compatibility yet...
>
In fact, thinking about this more. Bash-4.1 was released on 2010-01-03
so it will have been out for ~6 months before the next pacman release.
Anyone upgrading their package manager from 3.3 -> 3.4 will upgrade bash
from 4.0 -> 4.1 so this is probably a non-issue.
So I will accept this patch when the comment above and "stray" ! is
removed with it.
Allan
More information about the pacman-dev
mailing list