From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 13905210DBE6E for ; Mon, 6 Aug 2018 19:23:08 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2018 19:23:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,453,1526367600"; d="scan'208";a="60424229" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga007.fm.intel.com with ESMTP; 06 Aug 2018 19:20:16 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 6 Aug 2018 19:20:16 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 6 Aug 2018 19:20:15 -0700 Received: from shsmsx152.ccr.corp.intel.com ([169.254.6.150]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.205]) with mapi id 14.03.0319.002; Tue, 7 Aug 2018 10:20:13 +0800 From: "Gao, Liming" To: "Feng, YunhuaX" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] BaseTools:Fix incorrect %EDK_TOOLS_PATH% Thread-Index: AdQt7uBx6pLdqIY/Rm+TTQhHCukB+QABkpnQ Date: Tue, 7 Aug 2018 02:20:13 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2CDEB8@SHSMSX152.ccr.corp.intel.com> References: <47C64442C08CCD4089DC43B6B5E46BC48B1CCB@shsmsx102.ccr.corp.intel.com> In-Reply-To: <47C64442C08CCD4089DC43B6B5E46BC48B1CCB@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Tue, 07 Aug 2018 02:23:09 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, YunhuaX >Sent: Tuesday, August 07, 2018 9:36 AM >To: edk2-devel@lists.01.org >Cc: Zhu, Yonghong ; Gao, Liming > >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 comman= d >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 >--- > 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 > > 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 > ) > ) > > :checkNt32Flag > if exist %EDK_TOOLS_PATH%\Source set >BASE_TOOLS_PATH=3D%EDK_TOOLS_PATH% >-- >2.12.2.windows.2