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

next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart0(Thu_May_23_17_21_35_2013_044)--
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Thu_May_23_17_21_35_2013_383)--"
Content-Transfer-Encoding: 7bit

----Next_Part(Thu_May_23_17_21_35_2013_383)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Baptiste Daroussin <bapt@freebsd.org> 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

----Next_Part(Thu_May_23_17_21_35_2013_383)--
Content-Type: Text/X-Patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="config-nomenu_bsd.port.mk.20130523-1.diff"

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

----Next_Part(Thu_May_23_17_21_35_2013_383)----

----Security_Multipart0(Thu_May_23_17_21_35_2013_044)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (FreeBSD)

iEYEABECAAYFAlGd0Y8ACgkQTyzT2CeTzy3RmACgmLqw/3ymiYdtWbvWLXyTfoSc
S0sAoNy+nu7M6z//B+xkvrZ8QhbiGScv
=IDpF
-----END PGP SIGNATURE-----

----Security_Multipart0(Thu_May_23_17_21_35_2013_044)----



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