On 5/12/2009 12:31 AM, Greg Troxel wrote:
Sarton O'Brien<bsd-xen%roguewrt.org@localhost> writes:On 1/12/2009 2:09 AM, Joerg Sonnenberger wrote:On Mon, Nov 30, 2009 at 07:04:49AM -0800, Paul Goyette wrote:I defined PKG_OPTIONS.cups in my /etc/mk.conf file (to remove kerberos and add gs), but when I build the package, I get the following:Options are additive. To remove a specific option, prefix it with -. E.g. to remove kerberos: PKG_OPTIONS.cups= -kerberos.I noticed this a while back. I guess using '+=' is more for aesthetics then? ... My original assumption was that specifying only '=' would override.= overrides the assignment to the *variable* PKG_OPTIONS.cups. += is generally preferred if you don't know whether or not /etc/mk.conf had previously set something, perhaps unrelated.
Yep, being so specific I hadn't considered setting it any where other than mk.conf. So it's more of a precaution then :)
But, the options that are used are not the value of PKG_OPTIONS.cups, they are instead the contents of PKG_SUGGESTED_OPTIONS.cups, modifed by PKG_DEFAULT_OPTIONS, modified by PKG_OPTIONS.cups (maybe not in that order).
I figured there would be some kind of inheritance to allow for overriding, ie. if set then forget what anything else has set, or ... pass everything to PKG_OPTIONS.cups, which is where I assumed appending to the variable came in.
'make show-options' is very helpful. Perhaps the last line should say You can add or remove options by setting PKG_DEFAULT_OPTIONS or PKG_OPTIONS.cups to include, e.g., +option1 or -option2.
When starting out, the ability to negate the default options wasn't obvious. I went so far as to modify options.mk for the packages that I required a different set of defaults for. I think at least a mention would be useful.
Sarton