]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update edksetup.bat to check EDK_TOOLS_PATH before set it.
authorLiming Gao <liming.gao@intel.com>
Fri, 8 Apr 2016 05:32:07 +0000 (13:32 +0800)
committerLiming Gao <liming.gao@intel.com>
Mon, 11 Apr 2016 08:20:28 +0000 (16:20 +0800)
If EDK_TOOLS_PATH is set, then not set it again.
If EDK_TOOLS_PATH is not set, then set it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
edksetup.bat

index b69bd26857f573bc37c9e05437d6adb513bd0380..e065b6470a2b988d587b021e87524ad86cd9b738 100755 (executable)
@@ -1,7 +1,7 @@
 @REM @file\r
 @REM   Windows batch file to setup a WORKSPACE environment\r
 @REM\r
-@REM Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+@REM Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 @REM This program and the accompanying materials\r
 @REM are licensed and made available under the terms and conditions of the BSD License\r
 @REM which accompanies this distribution.  The full text of the license may be found at\r
@@ -100,21 +100,23 @@ shift
 :no_nt32\r
 \r
 if /I "%1"=="NewBuild" shift\r
-if exist %WORKSPACE%\BaseTools (\r
-  set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
-) else (\r
-  if defined PACKAGES_PATH (\r
-    for %%i IN (%PACKAGES_PATH%) DO (\r
-      if exist %%~fi\BaseTools (\r
-        set EDK_TOOLS_PATH=%%~fi\BaseTools\r
-        goto checkBaseTools\r
+if not defined EDK_TOOLS_PATH (\r
+  if exist %WORKSPACE%\BaseTools (\r
+    set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
+  ) else (\r
+    if defined PACKAGES_PATH (\r
+      for %%i IN (%PACKAGES_PATH%) DO (\r
+        if exist %%~fi\BaseTools (\r
+          set EDK_TOOLS_PATH=%%~fi\BaseTools\r
+          goto checkBaseTools\r
+        )\r
       )\r
+    ) else (\r
+      echo.\r
+      echo !!! ERROR !!! Cannot find BaseTools !!!\r
+      echo. \r
+      goto BadBaseTools\r
     )\r
-  ) else (\r
-    echo.\r
-    echo !!! ERROR !!! Cannot find BaseTools !!!\r
-    echo. \r
-    goto BadBaseTools\r
   )\r
 )\r
 if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%\r