Re: Documenting 'make config' options

2012-06-11 Thread Warren Block

On Sat, 9 Jun 2012, Warren Block wrote:


That's a nice idea, how do you make it work with dialog?


No idea, this is still the design phase. :)  Actually, a message I now 
can't find suggested that dialog may be able to do it unchanged.


Followup:

dialog --item-help \
 --checklist Contrived options description example 21 70 15 \
 ABC Enable ABC encapsulation of convoluted insoluble... on \
 variations when the complementary quantum reversal feature is undesirable \
 DOCS Build and install documentation on  \
 XYZ Enabling XYZ sets compiler go-fast stripes, defeats ..., off \
 all safeguards, and begins a wholesale, awesome, breathtaking data mangling \
 NLS Native Language Support via gettext utilities on 


Here is a patch to do it.

To use, apply patch.  Pick a port and edit the option descriptions to be 
longer than 49 characters.  Then run 'make config'.


Notes:

This patch only does descriptions for the plain options right now. 
Changes to the multi and single options would be the same thing.  (Not 
done because I'm hoping someone better at make(1) will have cleaner

methods.)

There's a cosmetic problem.  The last description line at the bottom of 
the screen remains after dialog exits.  I have not found a way to clear 
it in dialog.--- bsd.port.mk.orig2012-06-11 08:53:43.0 -0600
+++ bsd.port.mk 2012-06-11 12:50:08.0 -0600
@@ -6017,11 +6017,14 @@
 .if !target(pre-config)
 pre-config:
 _COMPLETE_OPTIONS_LIST:=   ${ALL_OPTIONS}
+VIS_WIDTH= 49
 .for opt in ${ALL_OPTIONS}
+${opt}_FIRST!= ${ECHO} ${${opt}_DESC:Q} | ${AWK} -F=\004 '{ ORS=; print 
substr($$0,1,${VIS_WIDTH}); if (length($1)${VIS_WIDTH}){print +} }'
+${opt}_REST!=  ${ECHO} ${${opt}_DESC:Q} | ${AWK} -F=\004 '{ print 
substr($$0,${VIS_WIDTH}+1) }'
 .  if empty(PORT_OPTIONS:M${opt})
-DEFOPTIONS+=   ${opt} ${${opt}_DESC:Q} off
+DEFOPTIONS+=   ${opt} ${${opt}_FIRST:Q} off ${${opt}_REST:Q}
 .  else
-DEFOPTIONS+=   ${opt} ${${opt}_DESC:Q} on
+DEFOPTIONS+=   ${opt} ${${opt}_FIRST:Q} on ${${opt}_REST:Q}
 .  endif
 .endfor
 .for multi in ${OPTIONS_MULTI}
@@ -6069,7 +6072,7 @@
 .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} || { \
+   ${DIALOG} --item-help --checklist Options for ${PKGNAME:C/-([^-]+)$/ 
\1/} 21 70 15 ${DEFOPTIONS} 2 $${TMPOPTIONSFILE} || { \
${RM} -f $${TMPOPTIONSFILE}; \
${ECHO_MSG} === Options unchanged; \
exit 0; \
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org

Re: Documenting 'make config' options

2012-06-11 Thread Warren Block

On Mon, 11 Jun 2012, Warren Block wrote:


Here is a patch to do it.

To use, apply patch.  Pick a port and edit the option descriptions to be 
longer than 49 characters.  Then run 'make config'.


Notes:

This patch only does descriptions for the plain options right now. Changes to 
the multi and single options would be the same thing.  (Not done because I'm 
hoping someone better at make(1) will have cleaner

methods.)

There's a cosmetic problem.  The last description line at the bottom of the 
screen remains after dialog exits.  I have not found a way to clear it in 
dialog.


And another note: VIS_WIDTH is set to 49 because that is the size 
available for a description on a standard 80x24 terminal (less one 
column for a + indicator).  But it can be dynamically determined with 
dialog --print-maxsize.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Documenting 'make config' options

2012-06-11 Thread Bryan Drewery
On 6/11/2012 2:03 PM, Warren Block wrote:
 On Sat, 9 Jun 2012, Warren Block wrote:
 
 That's a nice idea, how do you make it work with dialog?

 No idea, this is still the design phase. :)  Actually, a message I
 now can't find suggested that dialog may be able to do it unchanged.

 Followup:

 dialog --item-help \
  --checklist Contrived options description example 21 70 15 \
  ABC Enable ABC encapsulation of convoluted insoluble... on \
  variations when the complementary quantum reversal feature is
 undesirable \
  DOCS Build and install documentation on  \
  XYZ Enabling XYZ sets compiler go-fast stripes, defeats ..., off \
  all safeguards, and begins a wholesale, awesome, breathtaking data
 mangling \
  NLS Native Language Support via gettext utilities on 
 
 Here is a patch to do it.
 
 To use, apply patch.  Pick a port and edit the option descriptions to be
 longer than 49 characters.  Then run 'make config'.
 
 Notes:
 
 This patch only does descriptions for the plain options right now.
 Changes to the multi and single options would be the same thing.  (Not
 done because I'm hoping someone better at make(1) will have cleaner
 methods.)
 
 There's a cosmetic problem.  The last description line at the bottom of
 the screen remains after dialog exits.  I have not found a way to clear
 it in dialog.
 

Cool idea.

FYI --item-help is not supported on 8.3 and earlier so a OSVERSION check
is probably needed.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: Documenting 'make config' options

2012-06-10 Thread Vitaly Magerya
Baptiste Daroussin b...@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).
--- bsd.port.mk.orig2012-06-10 11:11:40.0 +0300
+++ bsd.port.mk 2012-06-10 12:15:44.0 +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; \
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org

Re: Documenting 'make config' options

2012-06-10 Thread Baptiste Daroussin
On Sun, Jun 10, 2012 at 01:00:05PM +0300, Vitaly Magerya wrote:
 Baptiste Daroussin b...@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).

 --- bsd.port.mk.orig  2012-06-10 11:11:40.0 +0300
 +++ bsd.port.mk   2012-06-10 12:15:44.0 +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


Re: Documenting 'make config' options

2012-06-09 Thread Doug Barton
On 06/06/2012 22:27, Dave Hayes wrote:
 Personally, a 'pkg-options-descr' text file would suit me just fine.

For those on -ports, the context is, How do we provide more information
about what the various options mean? This idea seems reasonable to me,
what do others think?

Doug

-- 

This .signature sanitized for your protection
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Documenting 'make config' options

2012-06-09 Thread Stephen Montgomery-Smith

On 06/09/2012 11:35 AM, Doug Barton wrote:

On 06/06/2012 22:27, Dave Hayes wrote:

Personally, a 'pkg-options-descr' text file would suit me just fine.


For those on -ports, the context is, How do we provide more information
about what the various options mean? This idea seems reasonable to me,
what do others think?


I think it is a good idea.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Documenting 'make config' options

2012-06-09 Thread Baptiste Daroussin
On Sat, Jun 09, 2012 at 09:35:12AM -0700, Doug Barton wrote:
 On 06/06/2012 22:27, Dave Hayes wrote:
  Personally, a 'pkg-options-descr' text file would suit me just fine.
 
 For those on -ports, the context is, How do we provide more information
 about what the various options mean? This idea seems reasonable to me,
 what do others think?
 
 Doug
 
 -- 
 
 This .signature sanitized for your protection
 ___
 freebsd-ports@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-ports
 To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org

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

regards,
Bapt


pgpdCLwnNscxz.pgp
Description: PGP signature


Re: Documenting 'make config' options

2012-06-09 Thread Warren Block

On Sat, 9 Jun 2012, Doug Barton wrote:


On 06/06/2012 22:27, Dave Hayes wrote:

Personally, a 'pkg-options-descr' text file would suit me just fine.


For those on -ports, the context is, How do we provide more information
about what the various options mean? This idea seems reasonable to me,
what do others think?


The user needs to know what the options mean when they appear, and 
having to go look them up in another file is just another hassle. 
Difficult to do in some situations, too.  Better to show them when the 
user scrolls to that option.  Here's what I suggested in -stable:

http://lists.freebsd.org/pipermail/freebsd-stable/2012-June/068187.html

No new files, only one copy of the descriptions so they don't get out of 
sync.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Documenting 'make config' options

2012-06-09 Thread Doug Barton
On 06/09/2012 17:54, Warren Block wrote:
 On Sat, 9 Jun 2012, Doug Barton wrote:
 
 On 06/06/2012 22:27, Dave Hayes wrote:
 Personally, a 'pkg-options-descr' text file would suit me just fine.

 For those on -ports, the context is, How do we provide more information
 about what the various options mean? This idea seems reasonable to me,
 what do others think?
 
 The user needs to know what the options mean when they appear, and
 having to go look them up in another file is just another hassle.
 Difficult to do in some situations, too.  Better to show them when the
 user scrolls to that option.  Here's what I suggested in -stable:
 http://lists.freebsd.org/pipermail/freebsd-stable/2012-June/068187.html
 
 No new files, only one copy of the descriptions so they don't get out of
 sync.

That's a nice idea, how do you make it work with dialog?


-- 

This .signature sanitized for your protection


___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Documenting 'make config' options

2012-06-09 Thread Warren Block

On Sat, 9 Jun 2012, Doug Barton wrote:


On 06/09/2012 17:54, Warren Block wrote:

On Sat, 9 Jun 2012, Doug Barton wrote:


On 06/06/2012 22:27, Dave Hayes wrote:

Personally, a 'pkg-options-descr' text file would suit me just fine.


For those on -ports, the context is, How do we provide more information
about what the various options mean? This idea seems reasonable to me,
what do others think?


The user needs to know what the options mean when they appear, and
having to go look them up in another file is just another hassle.
Difficult to do in some situations, too.  Better to show them when the
user scrolls to that option.  Here's what I suggested in -stable:
http://lists.freebsd.org/pipermail/freebsd-stable/2012-June/068187.html

No new files, only one copy of the descriptions so they don't get out of
sync.


That's a nice idea, how do you make it work with dialog?


No idea, this is still the design phase. :)  Actually, a message I now 
can't find suggested that dialog may be able to do it unchanged.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Documenting 'make config' options

2012-06-09 Thread Doug Barton
On 06/09/2012 18:10, Warren Block wrote:
 That's a nice idea, how do you make it work with dialog?
 
 No idea, this is still the design phase. :)  Actually, a message I now
 can't find suggested that dialog may be able to do it unchanged.

We have a solution that unquestionably will work, now. It's not ideal
from a UI standpoint, but it's better than the $nothing that we have
now. I would not want to see us wait around for something that may or
may not happen in the future.

That said, if we can make this work with dialog now, and someone is
willing to put the work in to make it happen, then sure, that's a better
plan. But let's not let perfect be the enemy of good.

Doug

-- 

This .signature sanitized for your protection


___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Documenting 'make config' options

2012-06-09 Thread Warren Block

On Sat, 9 Jun 2012, Warren Block wrote:


On Sat, 9 Jun 2012, Doug Barton wrote:


On 06/09/2012 17:54, Warren Block wrote:

On Sat, 9 Jun 2012, Doug Barton wrote:


On 06/06/2012 22:27, Dave Hayes wrote:

Personally, a 'pkg-options-descr' text file would suit me just fine.


For those on -ports, the context is, How do we provide more information
about what the various options mean? This idea seems reasonable to me,
what do others think?


The user needs to know what the options mean when they appear, and
having to go look them up in another file is just another hassle.
Difficult to do in some situations, too.  Better to show them when the
user scrolls to that option.  Here's what I suggested in -stable:
http://lists.freebsd.org/pipermail/freebsd-stable/2012-June/068187.html

No new files, only one copy of the descriptions so they don't get out of
sync.


That's a nice idea, how do you make it work with dialog?


No idea, this is still the design phase. :)  Actually, a message I now can't 
find suggested that dialog may be able to do it unchanged.


Followup:

dialog --item-help \
  --checklist Contrived options description example 21 70 15 \
  ABC Enable ABC encapsulation of convoluted insoluble... on \
  variations when the complementary quantum reversal feature is undesirable \
  DOCS Build and install documentation on  \
  XYZ Enabling XYZ sets compiler go-fast stripes, defeats ..., off \
  all safeguards, and begins a wholesale, awesome, breathtaking data mangling 
\
  NLS Native Language Support via gettext utilities on 


Now some code is needed to break descriptions too long to fit in the 
standard option box (preferably on spaces), right-justify ... or maybe 
+ at the end to show the line is continued, and integrate that with 
bsd.port.mk.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org