querying arbitrary variables via `port info --var`
René J.V. Bertin
rjvbertin at gmail.com
Fri Oct 23 13:02:58 PDT 2015
On Friday October 09 2015 21:38:47 René J.V. Bertin wrote:
Hey,
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?
Thanks,
René
> Hey,
>
> A while back Clemens implemented a feature that allows to query the list of patchfiles:
>
> port info --patchfiles foo
>
> that apparently works via a hardcoded list of known/supported variables. I *think* that Tcl allows to query arbitrary variables in this way, so that for instance one could do
>
> port info --configure.args foo
>
> or any of the variables that control fetch/configure/build/etc behaviour without having to modify base for each.
> This would be very convenient during port development when adding "ui_msg" statements to the Portfile to check variables could lead to accidental removal of a whole work directory (that might contain unsaved changes).
>
> My Tcl-fu isn't yet back to the level where I could assess how feasible this would be; is it?
>
> R.
More information about the macports-dev
mailing list