querying arbitrary variables via `port info --var`
René J.V. Bertin
rjvbertin at gmail.com
Mon Oct 26 03:53:53 PDT 2015
On Monday October 26 2015 11:06:13 Rainer Müller wrote:
>
> If we would want to dump all possible options, we also would need to
> keep a list when they are defined. That would be necessary to be added
> in port1.0/portutil.tcl.
Yeah, I saw that code, and wondered if there was a way around that necessity.
> However, as Ryan said, the actual value of an option may change during
> evaluation of phases. My approach usually includes adding a temporary
> ui_debug statement to the Portfile and checking the log when testing.
> Maybe it would be better to have some 'port dump' action for that
> purpose instead?
That proposition makes more sense after the "however" statement :)
Indeed, I could think of a `port dump <stage>` statement (potentially with the name of a variable of interest) that dumps the variables that are changed during the given stage, with their values. From what I understand most variables of potential interest are set/modified via macros, so it shouldn't require a complete redesign to keep track of which are changed.
Or alternatively, `port dump` could have the effect that no actual action is taken except for printing the value of (specified) variable(s) that are modified during the specified stage(s)?
I too use ui_msg statements currently, but there's always the risk of forgetting a -o option when you do that... (I'm actually surprised that I haven't hacked "base" yet to make that option the default ;)).
R.
More information about the macports-dev
mailing list