From: Louis Dionne Date: Tue, 31 Mar 2020 21:10:29 +0000 (-0400) Subject: [libc++] Use 'export' instead of 'env' to run remote commands X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c0dd57cd3e253b2ac7036366ef91e286422c830;p=platform%2Fupstream%2Fllvm.git [libc++] Use 'export' instead of 'env' to run remote commands This allows running commands that use shell builtins remotely too, when 'env' would complain that it can't find the program. --- diff --git a/libcxx/utils/ssh.py b/libcxx/utils/ssh.py index 20acaeb..02e1e3b 100644 --- a/libcxx/utils/ssh.py +++ b/libcxx/utils/ssh.py @@ -78,8 +78,12 @@ def main(): # Execute the command through SSH in the temporary directory, with the # correct environment. - command = [exe] + remaining if exe else remaining - res = subprocess.call(ssh('cd {} && env -i {} {}'.format(tmp, ' '.join(args.env), ' '.join(command)))) + commands = [ + 'cd {}'.format(tmp), + 'export {}'.format(' '.join(args.env)), + ' '.join([exe] + remaining if exe else remaining) + ] + res = subprocess.call(ssh(' && '.join(commands))) # Remove the temporary directory when we're done. subprocess.call(ssh('rm -r {}'.format(tmp)))