[pacman-dev] [PATCH] makepkg - add check for valid options in PKGBUILD
Xavier
shiningxc at gmail.com
Tue May 20 18:53:48 EDT 2008
On Tue, May 13, 2008 at 12:26 PM, Allan McRae <mcrae_allan at hotmail.com> wrote:
> +valid_options=0
> +for opt in ${options[@]}; do
> + known=1
> + # check if option matches a known option or its inverse
> + for kopt in ${known_options[@]}; do
> + if [ "${opt}" = "${kopt}" -o "${opt}" = "!${kopt}" ]; then
> + known=0
> + fi
> + done
> + if [ $known -eq 1 ]; then
> + error "$(gettext "options array contains unknown option '%s'")" "$opt"
> + valid_options=1
> + fi
> +done
> +if [ $valid_options -eq 1 ]; then
> + exit 1
> +fi
No big deal, but in my mind, the boolean value should be reversed.
known == 1 == true, or known == 0 == false.
So inverting known and valid_options make more sense to me :)
Other than that, the patch looks fine so I pulled it with that change :
http://shining.toofishes.net/gitweb/gitweb.cgi?p=pacman.git;a=commitdiff;h=824469c2e5122c4689747736dae944a43c8b84e0
More information about the pacman-dev
mailing list