Hi Juan, On Apr 16, 2007, at 6:28 PM, Juan Manuel Palacios wrote:
More than a comment, a question actually. If I recall and read it correctly, the previous conf file initialization code in base/src/ darwinports1.0/darwinports.tcl allowed only for one file to exist, either in the environment, ${prefix}/etc/ports/ports.conf or ~/.portsrc, in that order of precedence, iirc. They were all mutually exclusive, meaning that the sole presence of one would rule out the previous one(s) and therefore you could not have system wide values for options foo and bar in, say, ${prefix}/etc/ ports/ports.conf, and override only the value of bar in ~/.portsrc; supposing foo is some mandatory key in the conf file, like $ {prefix} itself, having only bar in ~/.portsrc would cause our base code to complain about foo not being found (and therefore abort). In other words, the previous code effectively allowed only for a single conf file with all the needed values concentrated in it, no spreading them around. So onto my question finally: is this still the case? If so, is this something we want? OK, that's two questions, I know ;-)
I intentionally kept the behavior the same as it was before. I think there are arguments to both behaviors (overriding the whole file vs overriding duplicate fields). Overall, the "only one file wins" strategy is probably simplest to understand, and since we don't have that many settings, probably not onerous for the user. I actually came upon this issue again when I added the (hidden) feature of parsing options from ~/.macports/user.conf. Should this file be allowed to contain only per-user settings (such as submitter name, submitter email, etc, for mpwa) or should it also allow the ports.conf settings to be overridden? I decided on the former, but once again there may be arguments to have _this_ be the mechanism to allow per-setting overrides for the system configuration settings. (For those curious, there are no settings read from user.conf that currently do anything, but the idea is that this will be a source of information about the current user, used while submitting ports to mpwa, which isn't yet available.) James