Optional Patches

Matthew Seaman m.seaman at infracaninophile.co.uk
Wed May 18 22:41:28 UTC 2011


On 18/05/2011 23:17, Doug Barton wrote:
> On 05/18/2011 15:10, Matthew Seaman wrote:
>> # Testing both WITH_ and WITHOUT_ is a good idea...
> 
> I'm not sure why you would need to test both, unless it's to catch wacky
> stuff coming in from the environment?

That's one reason.  Another is that it makes the layout of the .if block
handling that option independent of whether the option defaults to on or
off, which might just help avoid some logic errors.

Neither of which reasons is sufficiently compelling to make that style
preferable to just testing only one of WITH_ or WITHOUT_ in general.

> The usual way is to test the opposite of the default. So for default on
> you would test that WITHOUT_FOO is not defined.

There are plenty of examples of both styles in the ports.  Personal
preferences of the port maintainer is probably the biggest deciding factor.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew at infracaninophile.co.uk               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20110518/ea865657/signature.pgp


More information about the freebsd-ports mailing list