New Port Options

Baptiste Daroussin bapt at FreeBSD.org
Sat Oct 6 08:13:46 UTC 2012


On Fri, Oct 05, 2012 at 10:01:45PM -0700, Doug Hardie wrote:
> I just converted a port over to the new options structure and have a few observations.  I have not been involved in any of the discussions about the structure as I didn't have the time to get involved.  However, a couple things came to mind during the process:
> 
> 1.  The Port handbook is actually quite good in the information it provides.  However, it does presume that you know a few things about the port structure that are probably common knowledge to anyone involved with it, but not to those of us who just "use" it.  The first update I made to the Makefile cause a slew of make errors that were pretty much useless.  They meant nothing to me.  My first thought was that somehow I had munged one of the includes and managed to include some random file rather than the right one.
> 
> My second idea was that I had typed the option names wrong, but that didn't seem to fit with the error messages either.  After quite a while of reading the handbook, I noticed that in the PORT_OPTIONS clause you have to precede the option name with a M.  That is not at all obvious and is easily missed. Why an M is also baffling.  I am sure there is a reason other then it just won't work otherwise.
The M is because of make(1) syntax
> 
> 2.  The syntax for a conditional expression for an option that is selected is completely different from that for an option that is not selected.  That is just weird.  The use of {} for one and () for the other again must have some reason other than it just won't work otherwise.  No clue is given in the handbook.
> 
My first proposition for syntax was:
.if !empty(PORT_OPTIONS:MFOO)
.endif

and
.if empty(PORT_OPTIONS:MFOO)
.endif


Lots of people stated they prefered the concise version:
.if ${PORT_OPTIONS:MFOO}
.endif

the reverse of this one can be:

.if !${PORT_OPTIONS:MFOO}
.endif

instead of empty() if you prefer some maintainers uses it.
> 3.  The examples are a bit difficult to distinguish between {} and ().  I had to look quite a few times before I figured that out.
> 
> 4.  The handbook shows for submitting a change to a port the use of a regular diff.  My recollection is that the last time a unified diff was requested so that things like the file names show.
> 
> I only maintain one port so the effort to make the changes would have been quite minor for additional ports.  Its really not that big a change from the maintainer's point of view._______________________________________________
> freebsd-ports at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at freebsd.org"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20121006/4d65d273/attachment.pgp


More information about the freebsd-ports mailing list