[pacman-dev] [PATCH] makepkg - add check for valid options in PKGBUILD

Xavier shiningxc at gmail.com
Mon May 12 10:50:52 EDT 2008


On Mon, May 12, 2008 at 4:35 PM, Allan McRae <mcrae_allan at 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..
Btw, if this is for master, you forgot that one:
http://projects.archlinux.org/?p=pacman.git;a=commitdiff;h=dae3f9deefdb86f726a68dc89a7391e9df7517df




More information about the pacman-dev mailing list