diff options
author | William Deegan <bill@baddogconsulting.com> | 2020-07-11 01:29:27 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2020-07-11 01:29:27 (GMT) |
commit | 3c23953ee555ab9552a2a22cd16e25f0f5dfc408 (patch) | |
tree | 79d563414079015ae1dbc677bb81fe52803120b0 /SCons | |
parent | 6b15020834c8a1a64ee31ebb1f36132d1bb0177b (diff) | |
download | SCons-3c23953ee555ab9552a2a22cd16e25f0f5dfc408.zip SCons-3c23953ee555ab9552a2a22cd16e25f0f5dfc408.tar.gz SCons-3c23953ee555ab9552a2a22cd16e25f0f5dfc408.tar.bz2 |
Added TEMPFILEDIR to allow configuring where TEMPFILEMUNGE create's it's temporary files
Diffstat (limited to 'SCons')
-rw-r--r-- | SCons/Platform/__init__.py | 8 | ||||
-rw-r--r-- | SCons/Platform/__init__.xml | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/SCons/Platform/__init__.py b/SCons/Platform/__init__.py index 4c912d4..5d3541b 100644 --- a/SCons/Platform/__init__.py +++ b/SCons/Platform/__init__.py @@ -205,7 +205,13 @@ class TempFileMunge: else: suffix = '.lnk' - fd, tmp = tempfile.mkstemp(suffix, text=True) + if 'TEMPFILEDIR' in env: + tempfile_dir = env.subst('$TEMPFILEDIR') + os.makedirs(tempfile_dir, exist_ok=True) + else: + tempfile_dir = None + + fd, tmp = tempfile.mkstemp(suffix, dir=tempfile_dir, text=True) native_tmp = SCons.Util.get_native_path(tmp) if env.get('SHELL', None) == 'sh': diff --git a/SCons/Platform/__init__.xml b/SCons/Platform/__init__.xml index e877b1e..6582590 100644 --- a/SCons/Platform/__init__.xml +++ b/SCons/Platform/__init__.xml @@ -267,5 +267,11 @@ Note this value is used literally and not expanded by the subst logic. </summary> </cvar> - +<cvar name="TEMPFILEDIR"> +<summary> +<para> +The directory to create the tempfile in. +</para> +</summary> +</cvar> </sconsdoc> |