[libcxx] [test] Unbreak passing multiple env variables in ssh.py
authorMartin Storsjö <martin@martin.st>
Thu, 27 Apr 2023 07:11:05 +0000 (10:11 +0300)
committerMartin Storsjö <martin@martin.st>
Thu, 27 Apr 2023 16:25:59 +0000 (19:25 +0300)
No test actually does this, but this makes the option behave like
the corresponding one in run.py.

This was broken by commit b8b23aa80eefe84187d6ba364d06496c90c53bdb
(https://reviews.llvm.org/D99242) which introduced quoting; instead
of quoting the whole space separated list, quote each individual
argument.

Differential Revision: https://reviews.llvm.org/D149319

libcxx/utils/ssh.py

index 6c1d706..281ff10 100755 (executable)
@@ -109,7 +109,8 @@ def main():
         commandLine = (pathOnRemote(x) if isTestExe(x) else x for x in commandLine)
         remoteCommands.append('cd {}'.format(tmp))
         if args.env:
-            remoteCommands.append('export {}'.format(cmd_quote(' '.join(args.env))))
+            env = list(map(cmd_quote, args.env))
+            remoteCommands.append('export {}'.format(' '.join(args.env)))
         remoteCommands.append(subprocess.list2cmdline(commandLine))
 
         # Finally, SSH to the remote host and execute all the commands.