From: stevenknight Date: Mon, 15 Aug 2005 13:39:14 +0000 (+0000) Subject: Documentation fixes. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=afc4d4951dcee3e08124dec83ecbe92dd35b8890;p=scons.git Documentation fixes. Improve man page explanation of impact of not having external environment variables automatically imported. Fix cut-and-paste errors in descriptions of AppendENVPath() and Prepend(). Correct the __doc__ string for get_visualstudio_versions(). git-svn-id: http://scons.tigris.org/svn/scons/trunk@1334 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/doc/man/scons.1 b/doc/man/scons.1 index 96bd467f..14a0bf2e 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -149,6 +149,28 @@ import os env = Environment(ENV = {'PATH' : os.environ['PATH']}) .EE +Similarly, if the commands use external environment variables +like $PATH, $HOME, $JAVA_HOME, $LANG, $SHELL, $TERM, etc., +these variables can also be explicitly propagated: + +.ES +import os +env = Environment(ENV = {'PATH' : os.environ['PATH'], + 'HOME' : os.environ['HOME']}) +.EE + +Or you may explicitly propagate the invoking user's +complete external environment: + +.ES +import os +env = Environment(ENV = os.environ['PATH']) +.EE + +This comes at the expense of making your build +dependent on the user's environment being set correctly, +but it may be more convenient for many configurations. + .B scons can scan known input files automatically for dependency information (for example, #include statements @@ -2537,7 +2559,7 @@ Example: .ES print 'before:',env['ENV']['INCLUDE'] include_path = '/foo/bar:/foo' -env.PrependENVPath('INCLUDE', include_path) +env.AppendENVPath('INCLUDE', include_path) print 'after:',env['ENV']['INCLUDE'] yields: @@ -3716,7 +3738,7 @@ after: /foo/bar:/foo:/biz '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .TP -.RI env.AppendUnique( key = val ", [...])" +.RI env.PrependUnique( key = val ", [...])" Appends the specified keyword arguments to the beginning of construction variables in the environment. If the Environment does not have diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index e03eb8d4..90b756cd 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -765,11 +765,11 @@ def get_default_visualstudio_version(env): def get_visualstudio_versions(): """ - Get list of visualstudio versions from the Windows registry. Return a - list of strings containing version numbers; an exception will be raised - if we were unable to access the registry (eg. couldn't import - a registry-access module) or the appropriate registry keys weren't - found. + Get list of visualstudio versions from the Windows registry. + Returns a list of strings containing version numbers. An empty list + is returned if we were unable to accees the register (for example, + we couldn't import the registry-access module) or the appropriate + registry keys weren't found. """ if not SCons.Util.can_read_reg: