Reviewed-by: Liming Gao <liming....@intel.com>

>-----Original Message-----
>From: Feng, YunhuaX
>Sent: Tuesday, August 07, 2018 9:36 AM
>To: edk2-devel@lists.01.org
>Cc: Zhu, Yonghong <yonghong....@intel.com>; Gao, Liming
><liming....@intel.com>
>Subject: [PATCH] BaseTools:Fix incorrect %EDK_TOOLS_PATH%
>
>For non-root folder, such as "X:\bp", the EDK_TOOLS_PATH will
>resolve to "X:\bp\edk2\BaseTools". This is OK.
>
>But if WORKSPACE is at a root folder, such as "X:\", the EDK_TOOLS_PATH
>will look like "X:\\BaseTools". The *double backslash* can fail the command
>like "del" and thus affect the %ERRORLEVEL% variable, which may break
>subsequent build processing.
>
>Cc: Liming Gao <liming....@intel.com>
>Cc: Yonghong Zhu <yonghong....@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yunhua Feng <yunhuax.f...@intel.com>
>---
> edksetup.bat | 39 +++++++++++++++++++++++++--------------
> 1 file changed, 25 insertions(+), 14 deletions(-)
>
>diff --git a/edksetup.bat b/edksetup.bat
>index 97e2330e8c..c32755a471 100755
>--- a/edksetup.bat
>+++ b/edksetup.bat
>@@ -57,26 +57,37 @@ if /I "%1"=="/h" goto Usage
> if /I "%1"=="/?" goto Usage
> if /I "%1"=="/help" goto Usage
>
> if /I "%1"=="NewBuild" shift
> if not defined EDK_TOOLS_PATH (
>-  if exist %WORKSPACE%\BaseTools (
>-    set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
>-  ) else (
>-    if defined PACKAGES_PATH (
>-      for %%i IN (%PACKAGES_PATH%) DO (
>-        if exist %%~fi\BaseTools (
>-          set EDK_TOOLS_PATH=%%~fi\BaseTools
>-          goto checkNt32Flag
>-        )
>+  goto SetEdkToolsPath
>+) else (
>+  goto checkNt32Flag
>+)
>+
>+:SetEdkToolsPath
>+if %WORKSPACE:~-1% EQU \ (
>+  @set EDK_BASETOOLS=%WORKSPACE%BaseTools
>+) else (
>+  @set EDK_BASETOOLS=%WORKSPACE%\BaseTools
>+)
>+if exist %EDK_BASETOOLS% (
>+  set EDK_TOOLS_PATH=%EDK_BASETOOLS%
>+  set EDK_BASETOOLS=
>+) else (
>+  if defined PACKAGES_PATH (
>+    for %%i IN (%PACKAGES_PATH%) DO (
>+      if exist %%~fi\BaseTools (
>+        set EDK_TOOLS_PATH=%%~fi\BaseTools
>+        goto checkNt32Flag
>       )
>-    ) else (
>-      echo.
>-      echo !!! ERROR !!! Cannot find BaseTools !!!
>-      echo.
>-      goto BadBaseTools
>     )
>+  ) else (
>+    echo.
>+    echo !!! ERROR !!! Cannot find BaseTools !!!
>+    echo.
>+    goto BadBaseTools
>   )
> )
>
> :checkNt32Flag
> if exist %EDK_TOOLS_PATH%\Source set
>BASE_TOOLS_PATH=%EDK_TOOLS_PATH%
>--
>2.12.2.windows.2

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

Reply via email to