From owner-freebsd-ports@FreeBSD.ORG Sun May 26 21:31:20 2013 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 10E2B56D for ; Sun, 26 May 2013 21:31:20 +0000 (UTC) (envelope-from jos@catnook.com) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by mx1.freebsd.org (Postfix) with ESMTP id E0245E9C for ; Sun, 26 May 2013 21:31:19 +0000 (UTC) Received: by mail-pa0-f51.google.com with SMTP id lf10so5141443pab.10 for ; Sun, 26 May 2013 14:31:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=laUvEfyI9PyjSipzv0pzEYvAvST7h9H6VWEgYyz396U=; b=Eisihsm/gOPX9HJDQLQPnhObvqoKNTlzAq/2dwdqA70Im53eINaaB4xG9S0TS35DeC 4m9eVmlp8etbwCGi8ZG+MsEIg+T1NUDyWxOtMWE2AEmDV9C5LmqylcErLN32rKCNZtR4 8upq8UCBaEZDcx4xlIGH/1JM6fw/IAaOw1u1foNpwHlGmsTELP0PdPf7BZeQ+VP3WAzE PWT7zQquiIsQUnTJkWtMTjPpJAhmiTTRj9p3VFuSKziUACjLbi0AxYdOZ7sh2LSa64qC bYoBvl0i/nQSv+hCG5bvFSsBfC43c6ni01DyG18s8+3YY+cOXzKvj5oqh7g9YY0PJNMH 1S8g== MIME-Version: 1.0 X-Received: by 10.66.197.136 with SMTP id iu8mr27660126pac.0.1369603879109; Sun, 26 May 2013 14:31:19 -0700 (PDT) Received: by 10.70.11.130 with HTTP; Sun, 26 May 2013 14:31:19 -0700 (PDT) Received: by 10.70.11.130 with HTTP; Sun, 26 May 2013 14:31:19 -0700 (PDT) In-Reply-To: <20130523090630.GL96836@ithaqua.etoilebsd.net> References: <20130523054541.GH96836@ithaqua.etoilebsd.net> <20130523.172135.2156185641495785969.hrs@allbsd.org> <20130523090630.GL96836@ithaqua.etoilebsd.net> Date: Sun, 26 May 2013 14:31:19 -0700 Message-ID: Subject: Re: Proposal: do not show up the dialog(1) by default? From: Jos Backus To: Baptiste Daroussin X-Gm-Message-State: ALoCoQnvY28jNn/I6q1yDn9prGtdCaxW943pQAy9Qkstehn8f5OWutnAPiBsWOrt/xGPFRQMlrNH Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 21:31:20 -0000 Hi, On May 23, 2013 2:06 AM, "Baptiste Daroussin" wrote: > > On Thu, May 23, 2013 at 05:21:35PM +0900, Hiroki Sato wrote: > > Baptiste Daroussin wrote > > in <20130523054541.GH96836@ithaqua.etoilebsd.net>: > > > > ba> hi, > > ba> > > ba> A lot of people seems to be complaining about the configuration dialog 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 config? > > ba> > > ba> Just a proposal, please give your opinion. > > ba> > > ba> Of course make config-recursive behaviour won't change. > > > > 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. > > > > I think each port should define their knobs in OPTIONS_DEFINE even > > for global ones like DOCS because it is more consistent. > > > > -- Hiroki > > > Great thank you, I'll base my work on this patch. > > regards, > Bapt > > > Index: Mk/bsd.port.mk > > =================================================================== > > --- Mk/bsd.port.mk (revision 317459) > > +++ Mk/bsd.port.mk (working copy) > > @@ -6128,6 +6128,9 @@ > > .undef opt > > .endif # pre-config > > > > +OPTIONS_MENUTIMEOUT?= 5 > > +OPTIONS_NOMENU?= DOCS NLS EXAMPLES IPV6 > > +TPUT_CMD?= /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} "===> Cannot create $${optionsdir}, check permissions"; exit 1) > > .endif > > - @TMPOPTIONSFILE=$$(mktemp -t portoptions); \ > > + @if [ "${_RECURSIVE}" != 1 ]; then \ > > + for opt in ${PORT_OPTIONS}; do \ > > + oskip=0; \ > > + for nom in ${OPTIONS_NOMENU}; do \ > > + case $$opt in \ > > + $$nom) oskip=1 ;; \ > > + esac; \ > > + done; \ > > + case $$oskip in \ > > + 0) break ;; \ > > + esac; \ > > + done; \ > > + else \ > > + oskip=0; \ > > + fi; \ > > + if [ "$$oskip" = 1 ]; then \ > > + trap "${TPUT_CMD} me" 1 2 3 5 10 13 15; \ > > + ${TPUT_CMD} md; \ > > + ${ECHO_MSG} "===> This port has user configuration options."; \ > > + if read -t ${OPTIONS_MENUTIMEOUT} \ > > + -p "===> To open the configuration menu, hit enter key in ${OPTIONS_MENUTIMEOUT} seconds." \ > > + DUMMYARG; then \ > > + oskip=0; \ > > + fi; \ > > + ${TPUT_CMD} me; \ > > + fi; \ > > + TMPOPTIONSFILE=$$(mktemp -t portoptions); \ > > trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \ > > + if [ "$$oskip" = 0 ]; then \ > > ${SETENV} ${D4P_ENV} ${SH} ${PORTSDIR}/Tools/scripts/dialog4ports.sh $${TMPOPTIONSFILE} || { \ > > ${RM} -f $${TMPOPTIONSFILE}; \ > > ${ECHO_MSG} "===> Options unchanged"; \ > > exit 0; \ > > }; \ > > + fi; \ > > ${ECHO_CMD}; \ > > if [ ! -e $${TMPOPTIONSFILE} ]; then \ > > ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \ > > @@ -6196,7 +6227,7 @@ > > config-recursive: > > @${ECHO_MSG} "===> 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=1 config-conditional); \ > > done > > .endif # config-recursive > > > > @@ -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} != ${_FILE_COMPLETE_OPTIONS_LIST:O} > > - @cd ${.CURDIR} && ${MAKE} do-config; > > + @cd ${.CURDIR} && ${MAKE} _RECURSIVE=${_RECURSIVE} do-config; > > . endif > > .endif > > .endif # config-conditional > > > Small nit: in the above patch, one could use true and false to assign to oskip instead of 1 and 0, and test for $oskip. Methinks this would simplify the code and improve readability. Jos