]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/toolsetup.bat: fixed the error when the path contains space
authorYonghong Zhu <yonghong.zhu@intel.com>
Tue, 17 Nov 2015 07:45:04 +0000 (07:45 +0000)
committeryzhu52 <yzhu52@Edk2>
Tue, 17 Nov 2015 07:45:04 +0000 (07:45 +0000)
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.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18852 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/toolsetup.bat

index 59874c58392f7eab3edf8e72ed8e3ca658737ff0..310ddd030c077debab1e0c3b88e1c9ff1324515a 100755 (executable)
@@ -322,13 +322,24 @@ goto end
       echo !!! WARNING !!! Will not be able to compile Python programs to .exe\r
       echo Will setup environment to run Python scripts directly.\r
       echo.\r
-      set PATH=%BASETOOLS_PYTHON_SOURCE%\Trim;%PATH%\r
-      set PATH=%BASETOOLS_PYTHON_SOURCE%\GenFds;%PATH%\r
-      set PATH=%BASETOOLS_PYTHON_SOURCE%\build;%PATH%\r
-      set PATHEXT=%PATHEXT%;.py\r
+      goto UpdatePATH\r
     )\r
+    else (\r
+      goto UpdateEnv\r
+    )\r
+  )\r
+  else (\r
+    goto UpdateEnv\r
   )\r
-  \r
\r
+:UpdatePATH\r
+  set PATH=%BASETOOLS_PYTHON_SOURCE%\Trim;%PATH%\r
+  set PATH=%BASETOOLS_PYTHON_SOURCE%\GenFds;%PATH%\r
+  set PATH=%BASETOOLS_PYTHON_SOURCE%\build;%PATH%\r
+  set PATHEXT=%PATHEXT%;.py\r
+  goto UpdateEnv\r
\r
+:UpdateEnv\r
   echo BASE_TOOLS_PATH     = %BASE_TOOLS_PATH%\r
   echo     PYTHON_PATH     = %PYTHON_PATH%\r
   echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%\r