querying arbitrary variables via `port info --var`

Rainer Müller raimue at macports.org
Mon Oct 26 04:59:38 PDT 2015


On 2015-10-26 11:53, René J.V. Bertin wrote:
> 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.

My idea of 'port dump' was to only output options with their values once
after parsing the Portfile.

You can't get the value after a specific phase without execution of that
phase. Your proposal sounds more like a deeper debug log level instead
of a new port(1) action.

To get the difference, just take a snapshot of all options' values
(which requires the mentioned list of options) before the phase and
compare afterwards. Although I am not convinced such a diff would be useful.

Rainer


More information about the macports-dev mailing list