MacPorts API for default_variants

Joshua Root jmr at macports.org
Sat Jul 24 18:33:12 PDT 2010


On 2010-7-25 07:01 , Bill Georgitzikis wrote:
> Hi again, I would like to ask if there is a way to get the default_variants for a port, as well as conflicting variants. After implementing variants selection, it would be good to have the default variants pre-checked. However, the MacPorts Framework currently uses mportsearch which does not output this information, and the only other relevant call seems to be mportinfo, but it is experimental and unstable according to the documentation, and there is no mention of what data the PortInfo array it returns contains. 
> 
> Is there any way I could get this information? I believe it is essential to at least not allow the users to select two conflicting variants, if not pre-selecting the default variants as well. If not, then I would be glad to know that so I can stop this wild-goose chase and focus on more important tasks :)

You should be fine if you do it the same way as action_info in
base/src/port/port.tcl.

As an aside, are you using mportlookup instead of mportsearch when possible?

- Josh


More information about the macports-dev mailing list