From nobody Fri Apr 26 06:19:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1533605786236404.4563691318806; Mon, 6 Aug 2018 18:36:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 03FA0210DBE85; Mon, 6 Aug 2018 18:36:25 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D4F8A21BADAB9 for ; Mon, 6 Aug 2018 18:36:23 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2018 18:36:22 -0700 Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 06 Aug 2018 18:36:22 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 6 Aug 2018 18:36:21 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 6 Aug 2018 18:36:21 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.226]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.143]) with mapi id 14.03.0319.002; Tue, 7 Aug 2018 09:35:33 +0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,453,1526367600"; d="dat'59?scan'59,208,59";a="81229075" From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" Thread-Topic: [PATCH] BaseTools:Fix incorrect %EDK_TOOLS_PATH% Thread-Index: AdQt7uBx6pLdqIY/Rm+TTQhHCukB+Q== Date: Tue, 7 Aug 2018 01:35:33 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC48B1CCB@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC48B1CCB@shsmsx102.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.27 Subject: [edk2] [PATCH] BaseTools:Fix incorrect %EDK_TOOLS_PATH% X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Gao, Liming" Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RDMRC_1 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Liming Gao --- 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"=3D=3D"/h" goto Usage if /I "%1"=3D=3D"/?" goto Usage if /I "%1"=3D=3D"/help" goto Usage =20 if /I "%1"=3D=3D"NewBuild" shift if not defined EDK_TOOLS_PATH ( - if exist %WORKSPACE%\BaseTools ( - set EDK_TOOLS_PATH=3D%WORKSPACE%\BaseTools - ) else ( - if defined PACKAGES_PATH ( - for %%i IN (%PACKAGES_PATH%) DO ( - if exist %%~fi\BaseTools ( - set EDK_TOOLS_PATH=3D%%~fi\BaseTools - goto checkNt32Flag - ) + goto SetEdkToolsPath +) else ( + goto checkNt32Flag +) + +:SetEdkToolsPath +if %WORKSPACE:~-1% EQU \ ( + @set EDK_BASETOOLS=3D%WORKSPACE%BaseTools +) else ( + @set EDK_BASETOOLS=3D%WORKSPACE%\BaseTools +) +if exist %EDK_BASETOOLS% ( + set EDK_TOOLS_PATH=3D%EDK_BASETOOLS% + set EDK_BASETOOLS=3D +) else ( + if defined PACKAGES_PATH ( + for %%i IN (%PACKAGES_PATH%) DO ( + if exist %%~fi\BaseTools ( + set EDK_TOOLS_PATH=3D%%~fi\BaseTools + goto checkNt32Flag ) - ) else ( - echo. - echo !!! ERROR !!! Cannot find BaseTools !!! - echo. - goto BadBaseTools ) + ) else ( + echo. + echo !!! ERROR !!! Cannot find BaseTools !!! + echo. + goto BadBaseTools ) ) =20 :checkNt32Flag if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=3D%EDK_TOOLS_PATH% --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel