Documenting 'make config' options

Vitaly Magerya vmagerya at gmail.com
Sun Jun 10 10:00:08 UTC 2012


Baptiste Daroussin <bapt at freebsd.org> wrote:
> There was a PR[1] to use some dialog(1) feature to expose it to
> the user, would be nice if that extended description could
> implemented that way (using help button from dialog(1)) I do not
> plan to work on this now if someone want to do it that will be
> great
>
> 1: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/123185

I'm attaching a simple patch that allows you to hit F1 and view
pkg-options-descr file in the options dialog ("pkg-" prefix
should probably be removed, as that file has nothing to do with
packages).
-------------- next part --------------
--- bsd.port.mk.orig	2012-06-10 11:11:40.000000000 +0300
+++ bsd.port.mk	2012-06-10 12:15:44.000000000 +0300
@@ -2374,6 +2374,7 @@
 .endif
 
 DESCR?=			${PKGDIR}/pkg-descr
+OPTIONS_DESCR?=	${PKGDIR}/pkg-options-descr
 PLIST?=			${PKGDIR}/pkg-plist
 PKGINSTALL?=	${PKGDIR}/pkg-install
 PKGDEINSTALL?=	${PKGDIR}/pkg-deinstall
@@ -6068,8 +6069,15 @@
 	(${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1)
 .endif
 	@TMPOPTIONSFILE=$$(mktemp -t portoptions); \
+	if [ -e "${OPTIONS_DESCR}" ]; then \
+		helpopt="--hfile ${OPTIONS_DESCR}"; \
+		helptitle=" (F1 for details)"; \
+	else \
+		helpopt=""; \
+		helptitle=""; \
+	fi; \
 	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} || { \
+	${DIALOG} $${helpopt} --checklist "Options for ${PKGNAME:C/-([^-]+)$/ \1/}$${helptitle}" 21 70 15 ${DEFOPTIONS} 2> $${TMPOPTIONSFILE} || { \
 		${RM} -f $${TMPOPTIONSFILE}; \
 		${ECHO_MSG} "===> Options unchanged"; \
 		exit 0; \


More information about the freebsd-ports mailing list