[Scons-dev] How to get variables passed to Env(variables = whatever)?

William Deegan bill at baddogconsulting.com
Fri Oct 5 13:57:07 EDT 2012


Oleg,

If all you're looking to do is have foo in the shell environment of the commands you run, then you don't need to use Variables at all.
If you want to pass foo on the scons command line and have that affect the Environment(), though not the shell environment unless you explicitly copy the value:
env=Environment()
env['ENV']['foo']=env['foo']
Then Variables is useful.

Sounds like you really need to do a thorough read of the users guide and the man page.

-Bill

On Oct 5, 2012, at 9:42 AM, "Kenny, Jason L" <jason.l.kenny at intel.com> wrote:


> Variable objects are a defined type that allow for some basic validation, and conversion. With Variables you can control logic for example on how to deal with unknown values. This was meant to be an improvement over just taking the arguments and passing them in to the Environment.

>

> Jason

>

> -----Original Message-----

> From: scons-dev-bounces at scons.org [mailto:scons-dev-bounces at scons.org] On Behalf Of Left Right

> Sent: Friday, October 05, 2012 11:14 AM

> To: scons-dev at scons.org

> Subject: Re: [Scons-dev] How to get variables passed to Env(variables = whatever)?

>

> Nope, it doesn't. It was a typo, in the original code it was Environment, not Env.

> I can, however, do it like so:

>

> env = Environment(ENV = { 'foo' : 42 })

> env['ENV']['foo'] <--- this works then

>

> But was curious of the reason why not allow to do it via Variables?

>

> Thanks.

>

> Oleg

> _______________________________________________

> Scons-dev mailing list

> Scons-dev at scons.org

> http://two.pairlist.net/mailman/listinfo/scons-dev

> _______________________________________________

> Scons-dev mailing list

> Scons-dev at scons.org

> http://two.pairlist.net/mailman/listinfo/scons-dev




More information about the Scons-dev mailing list