From: g0dil Date: Fri, 28 May 2010 21:16:58 +0000 (+0000) Subject: Add CCACHE_ and DISTCC_ vars to imported environemnt X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=8c61b9c4468993136e3d11efaccf606c1a17764c;p=senf.git Add CCACHE_ and DISTCC_ vars to imported environemnt git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1633 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/SConstruct b/SConstruct index 0b729ab..3d97d47 100644 --- a/SConstruct +++ b/SConstruct @@ -59,10 +59,8 @@ Some unit tests will only run when executed to 'root'. """) env.Append( - ENV = { 'PATH' : os.environ.get('PATH'), - 'HOME' : os.environ.get('HOME'), - 'SSH_AGENT_PID': os.environ.get('SSH_AGENT_PID'), - 'SSH_AUTH_SOCK': os.environ.get('SSH_AUTH_SOCK') }, + IMPORT_ENV = [ 'PATH', 'HOME', 'SSH_*', 'SENF*', 'CCACHE_*', 'DISTCC_*' ], + CLEAN_PATTERNS = [ '*~', '#*#', '*.pyc', 'semantic.cache', '.sconsign*', '.sconf_temp' ], @@ -117,9 +115,6 @@ env.Append( LINKFLAGS_debug = [ '-g' ], ) -# Add all UNIX env vars starting with 'SENF' to the execution environment -env.Append( ENV = dict(((k,v) for k,v in os.environ.iteritems() if k.startswith("SENF"))) ) - env.SetDefault( LIBSENF = "senf", LCOV = "lcov", @@ -145,6 +140,12 @@ senfutil.parseArguments( BoolVariable('sparse_tests', 'Link tests against object files and not the senf lib', False) ) +# Add UNIX env vars matching IMPORT_ENV patterns into the execution environment +env.Append( ENV = dict(( (k,v) + for pattern in env['IMPORT_ENV'] + for k,v in os.environ.iteritems() + if fnmatch.fnmatchcase(k,pattern) )) ) + if 'test_changes' in COMMAND_LINE_TARGETS and not env.has_key('only_tests'): import SparseTestHack env['only_tests'] = " ".join(x.abspath for x in SparseTestHack.findSCMChanges(env))