]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Update python tool to call external tools with shell true mode
authorLiming Gao <liming.gao@intel.com>
Mon, 12 Sep 2016 07:22:49 +0000 (15:22 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 21 Sep 2016 02:49:15 +0000 (10:49 +0800)
Python tool may run from source as the dos batch files. So, update python
code to call external tools with shell true mode.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
BaseTools/Source/Python/Common/VpdInfoFile.py
BaseTools/Source/Python/build/build.py

index cc79ee275fd429fdcfb9ae9d9a5dd90682417f20..d45fb4cf0316106f2672d9c6799536da559dc5d6 100644 (file)
@@ -233,14 +233,15 @@ def CallExtenalBPDGTool(ToolPath, VpdFileName):
     OutputBinFileName = os.path.join(OutputDir, "%s.bin" % BaseName)\r
           \r
     try:\r
-        PopenObject = subprocess.Popen([ToolPath,\r
+        PopenObject = subprocess.Popen(' '.join([ToolPath,\r
                                         '-o', OutputBinFileName, \r
                                         '-m', OutputMapFileName,\r
                                         '-q',\r
                                         '-f',\r
-                                        VpdFileName],\r
+                                        VpdFileName]),\r
                                         stdout=subprocess.PIPE, \r
-                                        stderr= subprocess.PIPE)\r
+                                        stderr= subprocess.PIPE,\r
+                                        shell=True)\r
     except Exception, X:\r
         EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, ExtraData="%s" % (str(X)))\r
     (out, error) = PopenObject.communicate()\r
index be02119042f6a88776963beb50c1c4ee6f0b7b60..b003c6740356df8b9109087797562735ec10bb90 100644 (file)
@@ -268,12 +268,13 @@ def LaunchCommand(Command, WorkingDir):
     if not isinstance(Command, list):\r
         if platform.system() != 'Windows':\r
             Command = Command.split()\r
+            Command = ' '.join(Command)\r
 \r
     Proc = None\r
     EndOfProcedure = None\r
     try:\r
         # launch the command\r
-        Proc = Popen(Command, stdout=PIPE, stderr=PIPE, env=os.environ, cwd=WorkingDir, bufsize=-1)\r
+        Proc = Popen(Command, stdout=PIPE, stderr=PIPE, env=os.environ, cwd=WorkingDir, bufsize=-1, shell=True)\r
 \r
         # launch two threads to read the STDOUT and STDERR\r
         EndOfProcedure = Event()\r