querying arbitrary variables via `port info --var`

Ryan Schmidt ryandesign at macports.org
Fri Oct 23 13:20:58 PDT 2015


On Oct 23, 2015, at 3:02 PM, René J.V. Bertin  wrote:

> I managed to extend the `port info` syntax so that it accepts `port info --var foo` but of course ran into the issue that lots of variables aren't known when the code is evaluated.
> 
> Is there a way around that? Evidently that must be the case to some extent, otherwise the whole `port info --foo` feature wouldn't work. But a more generic workaround, would that be possible, maybe doing the double dereference in a macro/procedure that's in a context where everything from $prefix to $configure.args to $destroot.cmd are known?

Variables specific to phases, like configure.args and destroot.cmd, could theoretically (and are actually, in a few ports) be overridden or augmented in pre-phase blocks, like pre-configure or pre-destroot; MacPorts would be unable to account for such situations when displaying the variable for informational purposes. Other than that, I'd think it should be possible to display the variables. But I haven't seen the changes you've made to the code.



More information about the macports-dev mailing list