when the path contains space, it will report error for PATH Environment
update.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong....@intel.com>
---
 toolsetup.bat | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/toolsetup.bat b/toolsetup.bat
index 59874c5..310ddd0 100755
--- a/toolsetup.bat
+++ b/toolsetup.bat
@@ -320,17 +320,28 @@ goto end
     if not defined PYTHON_FREEZER_PATH (
       echo.
       echo !!! WARNING !!! Will not be able to compile Python programs to .exe
       echo Will setup environment to run Python scripts directly.
       echo.
-      set PATH=%BASETOOLS_PYTHON_SOURCE%\Trim;%PATH%
-      set PATH=%BASETOOLS_PYTHON_SOURCE%\GenFds;%PATH%
-      set PATH=%BASETOOLS_PYTHON_SOURCE%\build;%PATH%
-      set PATHEXT=%PATHEXT%;.py
+      goto UpdatePATH
     )
+    else (
+      goto UpdateEnv
+    )
+  )
+  else (
+    goto UpdateEnv
   )
-  
+ 
+:UpdatePATH
+  set PATH=%BASETOOLS_PYTHON_SOURCE%\Trim;%PATH%
+  set PATH=%BASETOOLS_PYTHON_SOURCE%\GenFds;%PATH%
+  set PATH=%BASETOOLS_PYTHON_SOURCE%\build;%PATH%
+  set PATHEXT=%PATHEXT%;.py
+  goto UpdateEnv
+ 
+:UpdateEnv
   echo BASE_TOOLS_PATH     = %BASE_TOOLS_PATH%
   echo     PYTHON_PATH     = %PYTHON_PATH%
   echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%
   echo.
 
-- 
2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to