Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 2013 11:06:31 +0200
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        Hiroki Sato <hrs@FreeBSD.org>
Cc:        ports@FreeBSD.org
Subject:   Re: Proposal: do not show up the dialog(1) by default?
Message-ID:  <20130523090630.GL96836@ithaqua.etoilebsd.net>
In-Reply-To: <20130523.172135.2156185641495785969.hrs@allbsd.org>
References:  <20130523054541.GH96836@ithaqua.etoilebsd.net> <20130523.172135.2156185641495785969.hrs@allbsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--tv2SIFopg1r47n4a
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, May 23, 2013 at 05:21:35PM +0900, Hiroki Sato wrote:
> Baptiste Daroussin <bapt@freebsd.org> wrote
>   in <20130523054541.GH96836@ithaqua.etoilebsd.net>:
>=20
> ba> hi,
> ba>
> ba> A lot of people seems to be complaining about the configuration dialo=
g popping
> ba> up all the time.
> ba>
> ba> What if we change the default behaviour to not pop up the dialog each=
 time there
> ba> is a changed option but only when the user explicitly type make confi=
g?
> ba>
> ba> Just a proposal, please give your opinion.
> ba>
> ba> Of course make config-recursive behaviour won't change.
>=20
>  I am using the attached patch locally to make the four global knobs
>  silent.  This is a kind of overkill, but "adding OPTIONS_NOMENU and
>  making the do-config target skip the dialog invocation when all of
>  values in OPTIONS_DEFINE are defined in OPTIONS_NOMENU" would be a
>  compromise.  If one wants dialog for the global knobs, OPTIONS_NOMENU
>  can always be redefined in make.conf.
>=20
>  I think each port should define their knobs in OPTIONS_DEFINE even
>  for global ones like DOCS because it is more consistent.
>=20
> -- Hiroki


Great thank you, I'll base my work on this patch.

regards,
Bapt

> Index: 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
> --- Mk/bsd.port.mk	(revision 317459)
> +++ Mk/bsd.port.mk	(working copy)
> @@ -6128,6 +6128,9 @@
>  .undef opt
>  .endif # pre-config
>=20
> +OPTIONS_MENUTIMEOUT?=3D	5
> +OPTIONS_NOMENU?=3D	DOCS NLS EXAMPLES IPV6
> +TPUT_CMD?=3D	/usr/bin/tput
>  .if !target(do-config)
>  do-config:
>  .if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI) =
&& empty(OPTIONS_RADIO) && empty(OPTIONS_GROUP)
> @@ -6144,13 +6147,41 @@
>  	${MKDIR} $${optionsdir} 2> /dev/null) || \
>  	(${ECHO_MSG} "=3D=3D=3D> Cannot create $${optionsdir}, check permission=
s"; exit 1)
>  .endif
> -	@TMPOPTIONSFILE=3D$$(mktemp -t portoptions); \
> +	@if [ "${_RECURSIVE}" !=3D 1 ]; then \
> +		for opt in ${PORT_OPTIONS}; do \
> +			oskip=3D0; \
> +			for nom in ${OPTIONS_NOMENU}; do \
> +				case $$opt in \
> +				$$nom)	oskip=3D1 ;; \
> +				esac; \
> +			done; \
> +			case $$oskip in \
> +			0)	break ;; \
> +			esac; \
> +		done; \
> +	else \
> +		oskip=3D0; \
> +	fi; \
> +	if [ "$$oskip" =3D 1 ]; then \
> +		trap "${TPUT_CMD} me" 1 2 3 5 10 13 15; \
> +		${TPUT_CMD} md; \
> +		${ECHO_MSG} "=3D=3D=3D> This port has user configuration options."; \
> +		if read -t ${OPTIONS_MENUTIMEOUT} \
> +		-p "=3D=3D=3D> To open the configuration menu, hit enter key in ${OPTI=
ONS_MENUTIMEOUT} seconds." \
> +		DUMMYARG; then \
> +			oskip=3D0; \
> +		fi; \
> +		${TPUT_CMD} me; \
> +	fi; \
> +	TMPOPTIONSFILE=3D$$(mktemp -t portoptions); \
>  	trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
> +	if [ "$$oskip" =3D 0 ]; then \
>  	${SETENV} ${D4P_ENV} ${SH} ${PORTSDIR}/Tools/scripts/dialog4ports.sh $$=
{TMPOPTIONSFILE} || { \
>  		${RM} -f $${TMPOPTIONSFILE}; \
>  		${ECHO_MSG} "=3D=3D=3D> Options unchanged"; \
>  		exit 0; \
>  	}; \
> +	fi; \
>  	${ECHO_CMD}; \
>  	if [ ! -e $${TMPOPTIONSFILE} ]; then \
>  		${ECHO_MSG} "=3D=3D=3D> No user-specified options to save for ${PKGNAM=
E}"; \
> @@ -6196,7 +6227,7 @@
>  config-recursive:
>  	@${ECHO_MSG} "=3D=3D=3D> Setting user-specified options for ${PKGNAME} =
and dependencies";
>  	@for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
> -		(cd $$dir; ${MAKE} config-conditional); \
> +		(cd $$dir; ${MAKE} _RECURSIVE=3D1 config-conditional); \
>  	done
>  .endif # config-recursive
>=20
> @@ -6204,7 +6235,7 @@
>  config-conditional: pre-config
>  .if defined(COMPLETE_OPTIONS_LIST) && !defined(NO_DIALOG)
>  .  if !defined(_FILE_COMPLETE_OPTIONS_LIST) || ${COMPLETE_OPTIONS_LIST:O=
} !=3D ${_FILE_COMPLETE_OPTIONS_LIST:O}
> -	@cd ${.CURDIR} && ${MAKE} do-config;
> +	@cd ${.CURDIR} && ${MAKE} _RECURSIVE=3D${_RECURSIVE} do-config;
>  .  endif
>  .endif
>  .endif # config-conditional




--tv2SIFopg1r47n4a
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlGd3BYACgkQ8kTtMUmk6Ewz2wCgqtEqGKxtDqrm2ruA0pvBrrze
FR8An13JnHvZ46fqfKB87souctBp8NK4
=RBC0
-----END PGP SIGNATURE-----

--tv2SIFopg1r47n4a--



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