FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 05-12-2008, 03:03 PM
Allan McRae
 
Default makepkg - add check for valid options in PKGBUILD

Xavier wrote:
> On Mon, May 12, 2008 at 4:35 PM, Allan McRae <mcrae_allan@hotmail.com> wrote:
>
>> Unknown and depreciated options are upgraded to error conditions.
>>
>> +known_options=('strip' 'docs' 'libtool' 'emptydirs' 'ccache' 'distcc' 'makeflags' 'force')
>> +valid_options=0
>> +for opt in ${options[@]}; do
>> + known=1
>> + for kopt in ${known_options[@]}; do
>> + if [ "${opt}" = "${kopt}" -o "${opt}" = "!${kopt}" ]; then
>> + known=0
>> + fi
>> + done
>> + if [ $known -eq 1 ]; then
>> + error "$(gettext "Unknown option '%s'")" "$opt"
>> + valid_options=1
>> + fi
>> +done
>> +if [ $valid_options -eq 1 ]; then
>> + exit 1
>> +fi
>> +
>>
>
> I see how this can be useful. I still find it a bit disappointing to
> have to maintain a list of valid options but I don't know..
>

From experience, if we are going to remove the depreciated options we
need to enforce it. There are still 77 packages in extra using
'nolibtool', some of which I am sure were updated recently. 1 still
uses keepdocs. Without this, the packages will get updated and these
will get overlooked. It is also good for catching spelling mistakes.

> Btw, if this is for master, you forgot that one:
> http://projects.archlinux.org/?p=pacman.git;a=commitdiff;h=dae3f9deefdb86f726a68 dc89a7391e9df7517df
>
>

So I did... I can see how having to maintain the list of options could
cause trouble! But I can't think of another way to do this.

Updated version of the patch will arrive tomorrow.

Allan




_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-13-2008, 10:25 AM
Allan McRae
 
Default makepkg - add check for valid options in PKGBUILD

Dan McGee wrote:
> On Mon, May 12, 2008 at 8:51 PM, Allan McRae <mcrae_allan@hotmail.com> wrote:
>
>>
>> +known_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'ccache' 'distcc' 'makeflags' 'force')
>>
> Perhaps we should throw this somewhere at the top of the script, since
> it is a constant? I'm thinking somewhere right after pkgdir & srcdir.
> In additoin, we can probably mark with either readonly or readonly -a
> as we don't want any scripts mucking with it.
>

I had to lookup what the -a flag actually did, but we do need it because
known_options is an array.

New version of the patch on its way.

Allan





_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 06:48 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org