Add Mac support to shell_env()
Project: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/commit/692d1d83 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/tree/692d1d83 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/diff/692d1d83 Branch: refs/heads/master Commit: 692d1d83d1eb731ef144d9072f6732fc78427b99 Parents: 7339d9e Author: Thomas Jackson <[email protected]> Authored: Tue Jan 27 15:26:11 2015 -0800 Committer: Thomas Jackson <[email protected]> Committed: Tue Jan 27 15:26:11 2015 -0800 ---------------------------------------------------------------------- tsqa/environment.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/692d1d83/tsqa/environment.py ---------------------------------------------------------------------- diff --git a/tsqa/environment.py b/tsqa/environment.py index 9e166ab..c11ac2d 100644 --- a/tsqa/environment.py +++ b/tsqa/environment.py @@ -228,10 +228,14 @@ class Environment: environ = copy.copy(os.environ) environ['TS_ROOT'] = self.layout.prefix - if environ.has_key('LD_LIBRARY_PATH') and self.layout.libdir not in environ['LD_LIBRARY_PATH'].split(':'): - environ['LD_LIBRARY_PATH'] = self.layout.libdir + ':' + environ['LD_LIBRARY_PATH'] - else: - environ['LD_LIBRARY_PATH'] = self.layout.libdir + for env_key in ('LD_LIBRARY_PATH', # for *nix + 'DYLD_LIBRARY_PATH', # for mac + ): + if environ.has_key(env_key) and self.layout.libdir not in environ[env_key].split(':'): + environ[env_key] = self.layout.libdir + ':' + environ[env_key] + else: + environ[env_key] = self.layout.libdir + return environ def __exec_cop(self):
