Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Dec 2012 14:01:01 -0600
From:      Bryan Drewery <bdrewery@freebsd.org>
To:        Baptiste Daroussin <bapt@freebsd.org>
Cc:        svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, ports-committers@freebsd.org
Subject:   Re: svn commit: r308598 - in head: . Mk
Message-ID:  <50CA33FD.8060805@FreeBSD.org>
In-Reply-To: <201212101014.qBAAE5xX084461@svn.freebsd.org>
References:  <201212101014.qBAAE5xX084461@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigA091E520B64FE6ACA8F9AE48
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 12/10/2012 4:14 AM, Baptiste Daroussin wrote:
> Author: bapt
> Date: Mon Dec 10 10:14:05 2012
> New Revision: 308598
> URL: http://svnweb.freebsd.org/changeset/ports/308598
>=20
> Log:
>   Extend the options framework providing 2 new macros:
>  =20
>   OPTIONS_RADIO: a more user friendly way to allow selecting only 0 or =
1 options
>                  among a list of options
>   OPTIONS_GROUP: this macros should be used to group options by theme a=
llowing the
>                  user to select 0 or N options among a list of options
>  =20
>   With hat:	portmgr
>   Reviewed by:	beat
>=20
> Modified:
>   head/CHANGES
>   head/Mk/bsd.options.mk
>   head/Mk/bsd.port.mk

Hmm, this is not recording the options in ALL_OPTIONS, which means they
don't get registered in pkgng packages.

- (~/freebsd/ports/ports-mgmt/portupgrade) $ make pretty-print-config
+DOCS DB_OVERRIDE( +BDB4 -BDB1 )
- (~/freebsd/ports/ports-mgmt/portupgrade) $ make -V ALL_OPTIONS
 DOCS

PKGNG Package:

options: {DOCS: on}

This causes poudriere to rebuild the package every time:

=3D=3D=3D=3D>> Options changed, deleting: apr-1.4.6.1.4.1_2.txz
=3D=3D=3D=3D>> Pkg:
=3D=3D=3D=3D>> New: BDB DEVRANDOM GDBM IPV6 SSL THREADS
=3D=3D=3D=3D>> Options changed, deleting: portupgrade-2.4.10.3,2.txz
=3D=3D=3D=3D>> Pkg: DOCS
=3D=3D=3D=3D>> New: BDB4 DOCS

>=20
> Modified: head/CHANGES
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/CHANGES	Mon Dec 10 10:05:43 2012	(r308597)
> +++ head/CHANGES	Mon Dec 10 10:14:05 2012	(r308598)
> @@ -10,6 +10,13 @@ in the release notes and/or placed into=20
> =20
>  All ports committers are allowed to commit to this file.
> =20
> +20121210:
> +AUTHOR: bapt@FreeBSD.org
> +  * OPTIONS has been extended 2 new macros are available:
> +
> +    OPTIONS_RADIO - allows only 0 or 1 options to be selected
> +    OPTIONS_GROUP - allows 0 or N options among to be selected
> +
>  20121010:
>  AUTHOR: bapt@FreeBSD.org
> =20
>=20
> Modified: head/Mk/bsd.options.mk
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/Mk/bsd.options.mk	Mon Dec 10 10:05:43 2012	(r308597)
> +++ head/Mk/bsd.options.mk	Mon Dec 10 10:14:05 2012	(r308598)
> @@ -12,15 +12,28 @@
>  # OPTIONS_EXCLUDE_${ARCH}	- List of options unsupported on a given ${A=
RCH}
>  # ${OPTION}_DESC		- Description the the ${OPTION}
>  #
> -# OPTIONS_SINGLE		- List of radio choice grouped options
> -# OPTIONS_MULTI			- List of multiple-choice grouped options
> +# OPTIONS_SINGLE		- List of single-choice grouped options: 1 and
> +# 				  only 1 among N
> +# OPTIONS_RADIO			- List of radio-choice grouped options: 0 or 1
> +#				  among N
> +# OPTIONS_MULTI			- List of multiple-choice grouped options: at
> +#				  least 1 among N
> +# OPTIONS_GROUP			- List of group-choice grouped options: 0 or
> +#				  more among N
>  #
> -# OPTIONS_SINGLE_${NAME}	- List of OPTIONS grouped as radio choice (fo=
r
> +# OPTIONS_SINGLE_${NAME}	- List of OPTIONS grouped as single choice (f=
or
>  #				the single named as ${NAME} as defined in
>  #				OPTIONS_SINGLE)
> -# OTPIONS_MULTI_${NAME}		- List of OPTIONS grouped as multiple-choice
> -#				(for the multi named as ${NAME} as defined in=20
> +# OPTIONS_RADIO_${NAME}		- List of OPTIONS grouped as radio choice (fo=
r
> +#				the radio named as ${NAME} as defined in
> +#				OPTIONS_RADIO)
> +# OPTIONS_MULTI_${NAME}		- List of OPTIONS grouped as multiple-choice
> +#				(for the multi named as ${NAME} as defined in
>  #				OPTIONS_MULTI)
> +# OPTIONS_GROUP_${NAME}		- List of OPTIONS grouped as group-choice (fo=
r
> +#				the group named as ${NAME} as defined in
> +#				OPTIONS_GROUP)
> +#
>  # WITH				Set options from the command line
>  # WITHOUT			Unset options from the command line
> =20
> @@ -28,6 +41,8 @@
>  # Set all the options available for the ports, beginning with the
>  # global ones and ending with the ones decided by the maintainer.
>  # Options global to the entire ports tree
> +.if !defined(OPTIONSMKINCLUDED)
> +OPTIONSMKINCLUDED=3D	bsd.options.mk
> =20
>  OPTIONSFILE?=3D	${PORT_DBDIR}/${UNIQUENAME}/options
> =20
> @@ -127,9 +142,15 @@ COMPLETE_OPTIONS_LIST=3D	${ALL_OPTIONS}
>  .for single in ${OPTIONS_SINGLE}
>  COMPLETE_OPTIONS_LIST+=3D	${OPTIONS_SINGLE_${single}}
>  .endfor
> +.for radio in ${OPTIONS_RADIO}
> +COMPLETE_OPTIONS_LIST+=3D	${OPTIONS_RADIO_${radio}}
> +.endfor
>  .for multi in ${OPTIONS_MULTI}
>  COMPLETE_OPTIONS_LIST+=3D	${OPTIONS_MULTI_${multi}}
>  .endfor
> +.for group in ${OPTIONS_GROUP}
> +COMPLETE_OPTIONS_LIST+=3D ${OPTIONS_GROUP_${group}}
> +.endfor
> =20
>  ## Now create the list of activated options
>  .if defined(OPTIONS_OVERRIDE)
> @@ -255,4 +276,5 @@ WITH_${opt}:=3D  true
>  .endif
>  .      undef opt
>  .endfor
> +.endif
>  ###
>=20
> Modified: head/Mk/bsd.port.mk
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/Mk/bsd.port.mk	Mon Dec 10 10:05:43 2012	(r308597)
> +++ head/Mk/bsd.port.mk	Mon Dec 10 10:14:05 2012	(r308598)
> @@ -3309,6 +3309,7 @@ DEPENDS_ARGS+=3D	NOCLEANDEPENDS=3Dyes
>  #
>  ################################################################
>  .if ((!defined(OPTIONS_DEFINE) && !defined(OPTIONS_SINGLE) && !defined=
(OPTIONS_MULTI)) \
> +	&& !defined(OPTIONS_GROUP) && !defined(OPTIONS_RADIO) \
>  	|| defined(CONFIG_DONE_${UNIQUENAME:U}) || \
>  	defined(PACKAGE_BUILDING) || defined(BATCH))
>  _OPTIONS_OK=3Dyes
> @@ -6004,6 +6005,19 @@ OPTIONS_WRONG_SINGLE+=3D	${single}
>  .endfor
>  .undef single
> =20
> +.for radio in ${OPTIONS_RADIO}
> +.  for opt in ${OPTIONS_RADIO_${radio}}
> +.    if !empty(PORT_OPTIONS:M${opt})
> +.      if defined(OPTFOUND)
> +OPTIONS_WRONG_RADIO+=3D	${radio}
> +.      else
> +OPTFOUND=3D	true
> +.      endif
> +.    endif
> +.  endfor
> +.  undef OPTFOUND
> +.endfor
> +
>  .for multi in ${OPTIONS_MULTI}
>  .  for opt in ${OPTIONS_MULTI_${multi}}
>  .    if empty(ALL_OPTIONS:M${multi}) || !empty(PORT_OPTIONS:M${multi})=

> @@ -6035,7 +6049,10 @@ _check-config: pre-check-config
>  .for single in ${OPTIONS_WRONG_SINGLE}
>  	@${ECHO_MSG} "=3D=3D=3D=3D> You must select one and only one option f=
rom the ${single} single"
>  .endfor
> -.if !empty(OPTIONS_WRONG_MULTI) || !empty(OPTIONS_WRONG_SINGLE)
> +.for radio in ${OPTIONS_WRONG_RADIO}
> +	@${ECHO_MSG} "=3D=3D=3D=3D> You cannot select multiple options from t=
he ${radio} radio"
> +.endfor
> +.if !empty(OPTIONS_WRONG_MULTI) || !empty(OPTIONS_WRONG_SINGLE) || !em=
pty(OPTIONS_WRONG_RADIO)
>  _CHECK_CONFIG_ERROR=3D	true
>  .endif
>  .endif # _check-config
> @@ -6087,14 +6104,33 @@ DEFOPTIONS+=3D	${opt} "S(${single}): "${${
>  .    endif
>  .  endfor
>  .endfor
> +.for radio in ${OPTIONS_RADIO}
> +.  for opt in ${OPTIONS_RADIO_${radio}}
> +.    if empty(PORT_OPTIONS:M${opt})
> +DEFOPTIONS+=3D	${opt} "R(${radio}): "${${opt}_DESC:Q} off
> +.    else
> +DEFOPTIONS+=3D	${opt} "R(${radio}): "${${opt}_DESC:Q} on
> +.    endif
> +.  endfor
> +.endfor
> +.for group in ${OPTIONS_GROUP}
> +.  for opt in ${OPTIONS_GROUP_${group}}
> +.    if empty(PORT_OPTIONS:M${opt})
> +DEFOPTIONS+=3D	${opt} "G(${group}): "${${opt}_DESC:Q} off
> +.    else
> +DEFOPTIONS+=3D	${opt} "G(${group}): "${${opt}_DESC:Q} on
> +.    endif
> +.  endfor
> +.endfor
>  .undef multi
>  .undef single
> +.undef group
>  .undef opt
>  .endif # pre-config
> =20
>  .if !target(do-config)
>  do-config:
> -.if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI=
)
> +.if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI=
) && empty(OPTIONS_RADIO) && empty(OPTIONS_GROUP)
>  	@${ECHO_MSG} "=3D=3D=3D> No options to configure"
>  .else
>  .if ${UID} !=3D 0 && !defined(INSTALL_AS_USER)
> @@ -6170,7 +6206,7 @@ config-conditional: pre-config
>  .if !target(showconfig)
>  .include "${PORTSDIR}/Mk/bsd.options.desc.mk"
>  showconfig:
> -.if !empty(ALL_OPTIONS) || !empty(OPTIONS_SINGLE) || !empty(OPTIONS_MU=
LTI)
> +.if !empty(ALL_OPTIONS) || !empty(OPTIONS_SINGLE) || !empty(OPTIONS_MU=
LTI) || !empty(OPTIONS_RADIO) || !empty(OPTIONS_GROUP)
>  	@${ECHO_MSG} "=3D=3D=3D> The following configuration options are avai=
lable for ${PKGNAME}":
>  .for opt in ${ALL_OPTIONS}
>  .  if empty(PORT_OPTIONS:M${opt})
> @@ -6215,8 +6251,40 @@ showconfig:
>  .  endfor
>  .endfor
> =20
> +.for radio in ${OPTIONS_RADIO}
> +	@${ECHO_MSG} "=3D=3D=3D=3D> Options available for the radio ${radio}:=
 you can only select none or one of them"
> +.  for opt in ${OPTIONS_RADIO_${radio}}
> +.    if empty(PORT_OPTIONS:M${opt})
> +	@${ECHO_MSG} -n "     ${opt}=3Doff"
> +.    else
> +	@${ECHO_MSG} -n "     ${opt}=3Don"
> +.    endif
> +.    if !empty(${opt}_DESC)
> +	@${ECHO_MSG} -n ": "${${opt}_DESC:Q}
> +.    endif
> +	@${ECHO_MSG} ""
> +.  endfor
> +.endfor
> +
> +.for group in ${OPTIONS_GROUP}
> +	@${ECHO_MSG} "=3D=3D=3D=3D> Options available for the group ${group}"=

> +.  for opt in ${OPTIONS_GROUP_${group}}
> +.    if empty(PORT_OPTIONS:M${opt})
> +	@${ECHO_MSG} -n "     ${opt}=3Doff"
> +.    else
> +	@${ECHO_MSG} -n "     ${opt}=3Don"
> +.    endif
> +.    if !empty(${opt}_DESC)
> +	@${ECHO_MSG} -n ": "${${opt}_DESC:Q}
> +.    endif
> +	@${ECHO_MSG} ""
> +.  endfor
> +.endfor
> +
>  .undef multi
>  .undef single
> +.undef radio
> +.undef group
>  .undef opt
>  	@${ECHO_MSG} "=3D=3D=3D> Use 'make config' to modify these settings"
>  .endif
> @@ -6288,8 +6356,32 @@ pretty-print-config:
>  .  endfor
>  	@${ECHO_MSG} -n ") "
>  .endfor
> +.for radio in ${OPTIONS_RADIO}
> +	@${ECHO_MSG} -n "${radio}( "
> +.  for opt in ${OPTIONS_RADIO_${radio}}
> +.    if empty(PORT_OPTIONS:M${opt})
> +	@${ECHO_MSG} -n "-${opt} "
> +.    else
> +	@${ECHO_MSG} -n "+${opt} "
> +.    endif
> +.  endfor
> +	@${ECHO_MSG} -n ") "
> +.endfor
> +.for group in ${OPTIONS_GROUP}
> +	@${ECHO_MSG} -n "${group}[ "
> +.  for opt in ${OPTIONS_GROUP_${group}}
> +.    if empty(PORT_OPTIONS:M${opt})
> +	@${ECHO_MSG} -n "-${opt} "
> +.    else
> +	@${ECHO_MSG} -n "+${opt} "
> +.    endif
> +.  endfor
> +	@${ECHO_MSG} -n "] "
> +.endfor
>  .undef multi
>  .undef single
> +.undef radio
> +.undef group
>  .undef opt
>  	@${ECHO_MSG} ""
>  .endif # pretty-print-config
>=20


--=20
Regards,
Bryan Drewery
bdrewery@freenode/EFNet


--------------enigA091E520B64FE6ACA8F9AE48
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBAgAGBQJQyjP9AAoJEG54KsA8mwz5RIQP/RLrglw233Hnhw86/9why0+i
/+BJFB4f2T6Jy/yP9zhh/MGuIZSxyuLcg7fir/zelGh5mF0v5LdSxo/eFdN142i3
ywQWf7Mcim71Eb9srGdQVk2g6VfTKWFHKKaYOEXtDy0N3XcqkwqK5mpkbCbP2y++
N9JeTz7i0o2YI67Kd62aErYgijg+qeTUxVWvkULp2+P+Se7oLYVxY7kmvU7I/+mL
Ni124x40FG3U9TakNpmqpKJ685WcKi4JtYjjbxvG26y1nzyQ6yK90gEbczgw53Jh
kwvf+K7iYkKCjvVGszI2QIaVmdw3JEQngDZPDIkR4UMv9Gy0ok/AqV2H7plIoNK/
db//kCIsG8VFG9h0ESWCLIrvk8lJBOmd1OooUz4fgDJ20k3Nez838xUvu+9N6Ups
3lf9e+DC3+0wKecGFRNQpamZRND1oLzqHTu0Fal/EY8Y9x1wUX9gH3sffUX7h275
dbHcnlmQJfcdf45NOEE1y6vseOSl87bJDUCzQoqWvgAVO/yHCIsQvFGqgnxrCyWA
pioj8fkLIFBQDrnaUPy4EEiiZbI351OkEg6JsaCJdoZ8XUmg7l74sML3j4PJXz/D
xbenH4p5yV94XzRNxfK8Rr/4lPkHV8/SwjnL5MsFBUP4ir6tal4KfmvGXTBpklEL
ueS/j7tSz865/aWY86YT
=StY7
-----END PGP SIGNATURE-----

--------------enigA091E520B64FE6ACA8F9AE48--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50CA33FD.8060805>