[pacman-dev] [PATCH 1/2] makepkg: Add helper to test for functions in build script
Allan McRae
allan at archlinux.org
Sat May 18 20:22:20 EDT 2013
On 19/05/13 01:37, Dave Reisner wrote:
> On May 18, 2013 10:10 AM, "Allan McRae" <allan at archlinux.org> wrote:
>>
>> Signed-off-by: Allan McRae <allan at archlinux.org>
>> ---
>> scripts/makepkg.sh.in | 18 +++++++++++-------
>> 1 file changed, 11 insertions(+), 7 deletions(-)
>>
>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>> index c311c30..8b222da 100644
>> --- a/scripts/makepkg.sh.in
>> +++ b/scripts/makepkg.sh.in
>> @@ -2095,6 +2095,10 @@ install_package() {
>> fi
>> }
>>
>> +has_function() {
>> + return $(declare -f $1 >/dev/null)
>
> Quotes on $1 please.
>
>> +}
>
> If this works, its only by chance. Just call declare and the return value
> will work itself out.
>
> Would also prefer have_ instead of has_ but that's a minor point.
>
All fixed on my working branch.
Allan
More information about the pacman-dev
mailing list