On Sun, Jun 10, 2012 at 01:00:05PM +0300, Vitaly Magerya wrote: > Baptiste Daroussin <[email protected]> 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).
> --- 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; \
Besides I might change some naming here, (not much) this looks a really clever
way of bringing the features much more clever than what I could have been
thinking of. Thank you very much, I do some testing on it soon.
what I like is having a complete text to describe options, and not being
limited to per option description.
On the change I'll just change OPTIONS_DESCR to OPTIONS_HELP and
pkg-options-descr to options-help
Thank you very much for the patch!
regards,
Bapt
pgp9jgipSER03.pgp
Description: PGP signature
