[58794] trunk/dports/_resources/port1.0/group/archcheck-1.0.tcl

Joshua Root jmr at macports.org
Mon Oct 5 19:24:09 PDT 2009


On 2009-10-6 11:30, Ryan Schmidt wrote:
> Mmm, yes, because the port might modify configure.build_arch or
> configure.universal_archs, right? But the port can't modify build_arch
> or universal_archs?

You can technically modify any variable with 'set', but you're not
really meant to. The configure.* ones are actual options.

> What's the significance of checking [variant_exists universal]? If the
> variant doesn't exist, then [variant_isset universal] will be false,
> won't it? Or does it cause some kind of exception to check whether a
> nonexistent variant is set?

[variant_isset foo] is true if +foo is on the command line or in
variants.conf, independent of whether the port actually has a foo variant.

[variant_exists foo] is only true if it is run after the foo variant is
defined. Usually this means it should only be used inside a phase. Of
course, you usually don't need to use it outside of portgroups and base
code, since when you write a portfile you aren't really going to test
whether variants are set unless you know the port has them.

- Josh


More information about the macports-dev mailing list