From owner-svn-ports-head@FreeBSD.ORG Tue Mar 19 09:27:53 2013 Return-Path: Delivered-To: svn-ports-head@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 4C1EFFD2; Tue, 19 Mar 2013 09:27:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 303032DD; Tue, 19 Mar 2013 09:27:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2J9RrlR021188; Tue, 19 Mar 2013 09:27:53 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2J9RqXd021185; Tue, 19 Mar 2013 09:27:52 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201303190927.r2J9RqXd021185@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 19 Mar 2013 09:27:52 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r314628 - in head: . Mk X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2013 09:27:53 -0000 Author: bapt Date: Tue Mar 19 09:27:52 2013 New Revision: 314628 URL: http://svnweb.freebsd.org/changeset/ports/314628 Log: Make the ports tree use dialog4ports for make config. dialog4ports has been contributed by Ilya A. Arkhipov. It extends dialog(3) to provide a mixed dialog widget allowing to represent all features provide by the new options framework. This allows the ports tree to not anymore depends on dialog(1) from base to configure the options and be able to improve if needed on all supported plateforms at the same time. Exp-run by: miwi Modified: head/CHANGES head/Mk/bsd.commands.mk head/Mk/bsd.port.mk Modified: head/CHANGES ============================================================================== --- head/CHANGES Tue Mar 19 09:13:44 2013 (r314627) +++ head/CHANGES Tue Mar 19 09:27:52 2013 (r314628) @@ -10,6 +10,16 @@ in the release notes and/or placed into All ports committers are allowed to commit to this file. +20130319: +AUTHOR: bapt@FreeBSD.org + + * The options framework now uses ports-mgmt/dialog4ports contributed by + Ilya A. Arkhipov. It boostraps it if not present when one calls + make config. + + dialog4ports provides a new UI able to represent all the features + provided by the new options framework. + 20130315: AUTHOR: bdrewery@FreeBSD.org Modified: head/Mk/bsd.commands.mk ============================================================================== --- head/Mk/bsd.commands.mk Tue Mar 19 09:13:44 2013 (r314627) +++ head/Mk/bsd.commands.mk Tue Mar 19 09:27:52 2013 (r314628) @@ -34,6 +34,7 @@ CPIO?= /usr/bin/cpio CUT?= /usr/bin/cut DC?= /usr/bin/dc DIALOG?= /usr/bin/dialog +DIALOG4PORTS?= ${LOCALBASE}/bin/dialog4ports DIFF?= /usr/bin/diff DIRNAME?= /usr/bin/dirname EGREP?= /usr/bin/egrep Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Tue Mar 19 09:13:44 2013 (r314627) +++ head/Mk/bsd.port.mk Tue Mar 19 09:27:52 2013 (r314628) @@ -2409,6 +2409,7 @@ COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$ DESCR?= ${PKGDIR}/pkg-descr PLIST?= ${PKGDIR}/pkg-plist +PKGHELP?= ${PKGDIR}/pkg-help PKGINSTALL?= ${PKGDIR}/pkg-install PKGDEINSTALL?= ${PKGDIR}/pkg-deinstall PKGREQ?= ${PKGDIR}/pkg-req @@ -6077,47 +6078,45 @@ sanity-config: _check-config .if !target(pre-config) pre-config: +D4P_ENV= PKGNAME="${PKGNAME}" \ + PORT_OPTIONS="${PORT_OPTIONS}" \ + ALL_OPTIONS="${ALL_OPTIONS}" \ + OPTIONS_MULTI="${OPTIONS_MULTI}" \ + OPTIONS_SINGLE="${OPTIONS_SINGLE}" \ + OPTIONS_RADIO="${OPTIONS_RADIO}" \ + OPTIONS_GROUP="${OPTIONS_GROUP}" +.if exists(${PKGHELP}) +D4P_ENV+= PKGHELP="${PKGHELP}" +.endif .for opt in ${ALL_OPTIONS} -. if empty(PORT_OPTIONS:M${opt}) -DEFOPTIONS+= ${opt} ""${${opt}_DESC:Q} off -. else -DEFOPTIONS+= ${opt} ""${${opt}_DESC:Q} on -. endif +D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}"" .endfor .for multi in ${OPTIONS_MULTI} +D4P_ENV+= OPTIONS_MULTI_${multi}="${OPTIONS_MULTI_${multi}}" \ + ${multi}_DESC=""${${opt}_DESC:Q}"" . for opt in ${OPTIONS_MULTI_${multi}} -. if empty(PORT_OPTIONS:M${opt}) -DEFOPTIONS+= ${opt} "M(${multi}): "${${opt}_DESC:Q} off -. else -DEFOPTIONS+= ${opt} "M(${multi}): "${${opt}_DESC:Q} on -. endif +D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}"" . endfor .endfor .for single in ${OPTIONS_SINGLE} +D4P_ENV+= OPTIONS_SINGLE_${single}="${OPTIONS_SINGLE_${single}}" \ + ${single}_DESC=""${${single}_DESC:Q}"" . for opt in ${OPTIONS_SINGLE_${single}} -. if empty(PORT_OPTIONS:M${opt}) -DEFOPTIONS+= ${opt} "S(${single}): "${${opt}_DESC:Q} off -. else -DEFOPTIONS+= ${opt} "S(${single}): "${${opt}_DESC:Q} on -. endif +D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}"" . endfor .endfor .for radio in ${OPTIONS_RADIO} +D4P_ENV+= OPTIONS_RADIO_${radio}="${OPTIONS_RADIO_${radio}}" \ + ${radio}_DESC=""${${radio}_DESC:Q}"" . for opt in ${OPTIONS_RADIO_${radio}} -. if empty(PORT_OPTIONS:M${opt}) -DEFOPTIONS+= ${opt} "R(${radio}): "${${opt}_DESC:Q} off -. else -DEFOPTIONS+= ${opt} "R(${radio}): "${${opt}_DESC:Q} on -. endif +D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}"" . endfor .endfor .for group in ${OPTIONS_GROUP} +D4P_ENV+= OPTIONS_GROUP_${group}="${OPTIONS_GROUP_${group}}" \ + ${group}_DESC=""${${group}_DESC:Q}"" . for opt in ${OPTIONS_GROUP_${group}} -. if empty(PORT_OPTIONS:M${opt}) -DEFOPTIONS+= ${opt} "G(${group}): "${${opt}_DESC:Q} off -. else -DEFOPTIONS+= ${opt} "G(${group}): "${${opt}_DESC:Q} on -. endif +D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}"" . endfor .endfor .undef multi @@ -6144,7 +6143,7 @@ do-config: .endif @TMPOPTIONSFILE=$$(mktemp -t portoptions); \ trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \ - ${DIALOG} --checklist "Options for ${PKGNAME:C/-([^-]+)$/ \1/}" 21 70 15 ${DEFOPTIONS} 2> $${TMPOPTIONSFILE} || { \ + ${SETENV} ${D4P_ENV} ${DIALOG4PORTS} > $${TMPOPTIONSFILE} || { \ ${RM} -f $${TMPOPTIONSFILE}; \ ${ECHO_MSG} "===> Options unchanged"; \ exit 0; \ @@ -6180,8 +6179,21 @@ do-config: .endif .endif # do-config +.if !target(config-depend) +config-depend: +.if !exists(${DIALOG4PORTS}) + @echo -n "dialog4ports isn't installed, do you want to install it now? [Y/n] "; \ + read answer; \ + case $$answer in \ + [Nn]|[Nn][Oo]) \ + exit 0; \ + esac; \ + cd ${PORTSDIR}/ports-mgmt/dialog4ports; ${MAKE} install +.endif +.endif + .if !target(config) -config: pre-config do-config +config: pre-config config-depend do-config .endif # config .if !target(config-recursive)