From: Michael Kinney Date: Tue, 31 Jan 2017 17:21:20 +0000 (-0800) Subject: BaseTools/Build: Support python scripts in PREBUILD/POSTBUILD X-Git-Tag: edk2-stable201903~3804 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=b926f2f2a4cd404df1d2c1dddbcd1178acc63b5e;hp=b1fe2029fa2f473922fb830a2e33c5ae0c0ae20d BaseTools/Build: Support python scripts in PREBUILD/POSTBUILD https://bugzilla.tianocore.org/show_bug.cgi?id=627 Add shell=True in Popen() calls to support direct execution of python scripts Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney Reviewed-by: Yonghong Zhu --- diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index cfd28a4b5b..1e14fb4dcc 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1036,7 +1036,7 @@ class Build(): os.remove(self.PlatformBuildPath) if sys.platform == "win32": args = ' && '.join((self.Prebuild, 'set > ' + PrebuildEnvFile)) - Process = Popen(args, stdout=PIPE, stderr=PIPE) + Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True) else: args = ' && '.join((self.Prebuild, 'env > ' + PrebuildEnvFile)) Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True) @@ -1079,7 +1079,7 @@ class Build(): if self.Postbuild: EdkLogger.info("\n- Postbuild Start -\n") if sys.platform == "win32": - Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE) + Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True) else: Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True) # launch two threads to read the STDOUT and STDERR