[PATCH] D11350: [lit] implement 'env' as shell builtin

Tzafrir tzafrir11 at gmail.com
Mon Jul 20 04:09:40 PDT 2015


Tzafrir created this revision.
Tzafrir added reviewers: yaron.keren, rnk.
Tzafrir added a subscriber: llvm-commits.

Add implementation of env command as an internal shell builtin.

http://reviews.llvm.org/D11350

Files:
  TestRunner.py

Index: TestRunner.py
===================================================================
--- TestRunner.py
+++ TestRunner.py
@@ -71,6 +71,15 @@
         else:
             shenv.cwd = os.path.join(shenv.cwd, newdir)
         return 0
+    elif cmd.commands[0].args[0] == 'env':
+        for i in range(len(cmd.commands[0].args)-1):
+            envs=cmd.commands[0].args[i+1].split('=',1)
+            if len(envs)>1:
+                shenv.env[envs[0]]=envs[1]
+            else:
+                #Remove parsed arguments from args list
+                cmd.commands[0].args=cmd.commands[0].args[i+1:]
+                break
 
     procs = []
     input = subprocess.PIPE


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11350.30146.patch
Type: text/x-patch
Size: 673 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150720/7ba59bf6/attachment.bin>


More information about the llvm-commits mailing list