svn commit: r314628 - in head: . Mk

Baptiste Daroussin bapt at FreeBSD.org
Tue Mar 19 09:27:53 UTC 2013


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 at 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 at 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)


More information about the svn-ports-all mailing list