From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 840A0803D6 for ; Mon, 13 Mar 2017 23:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489474740; x=1521010740; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=w0ebFzGyyUZeOK/WiCxfPzAZwTUsM06/C5pUcDb5gqE=; b=OFswtMqEG8IFBoGvGuON7mxTb2yL4KN4wg7k82W9wRGO3YDleWhMGEDq bQkXtvzJV3slD6MPQM9cExPNMdO3Bg==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2017 23:59:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,162,1486454400"; d="scan'208";a="76356246" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 13 Mar 2017 23:58:59 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 13 Mar 2017 23:58:59 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 13 Mar 2017 23:58:59 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Tue, 14 Mar 2017 14:58:57 +0800 From: "Zhu, Yonghong" To: "Chen, Hesheng" , "edk2-devel@lists.01.org" Thread-Topic: [patch] BaseTools/UPT: Fix an issue in subst command Thread-Index: AQHSmTTR/RVArllYdkm66SLd4aI+2aGT7WGQ Date: Tue, 14 Mar 2017 06:58:57 +0000 Message-ID: References: <1489105521-146108-1-git-send-email-hesheng.chen@intel.com> In-Reply-To: <1489105521-146108-1-git-send-email-hesheng.chen@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/UPT: Fix an issue in subst command X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2017 06:59:00 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: Chen, Hesheng=20 Sent: Friday, March 10, 2017 8:25 AM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong Subject: [patch] BaseTools/UPT: Fix an issue in subst command UPT used to use "B:" as the temp directory which may cause conflict, now it= will choose a valid volume. Also UPT now accepts empty sections. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: hesschen --- .../UPT/Parser/InfGuidPpiProtocolSectionParser.py | 7 ++++--- BaseTools/Source/Python/UPT/UPT.py | 20 +++++++++++-----= ---- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionPa= rser.py b/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParse= r.py index 10a82cb..12ffeda 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser +++ .py @@ -1,7 +1,7 @@ ## @file # This file contained the parser for [Guids], [Ppis], [Protocols] sections= in INF file # -# Copyright (c) 2011, Intel Corporation. All rights reserv= ed.
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights=20 +reserved.
# # This program and the accompanying materials are licensed and made availa= ble # under the terms and conditions of the BSD License which accompanies = this @@ -217,8 +217,9 @@ class InfGuidPpiProtocolSectionParser(InfParserSec= tionRoot): for Line in SectionString: LineContent =3D Line[0] =20 - if LineContent.strip() =3D=3D '': - continue +# Comment the code to support user extension without any statement just th= e section header in [] +# if LineContent.strip() =3D=3D '': +# continue =20 UserExtensionContent +=3D LineContent + DT.END_OF_LINE continue diff --git a/BaseTools/Source/Python/UPT/UPT.py b/BaseTools/Source/Python/U= PT/UPT.py index 8dd949a..873492d 100644 --- a/BaseTools/Source/Python/UPT/UPT.py +++ b/BaseTools/Source/Python/UPT/UPT.py @@ -2,7 +2,7 @@ # # This file is the main entry for UPT # -# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights=20 +reserved.
# # This program and the accompanying materials are licensed and made availa= ble # under the terms and conditions of the BSD License which accompanies = this @@ -179,15 +179,16 @@ def Main(): Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += format_exc()) return XExcept.args[0] =20 - # Start ********************************************* # Support WORKSPACE is a long path - # Only work well on windows - # Linux Solution TBD + # Only works for windows system if pf.system() =3D=3D 'Windows': - os.system('@echo off\nsubst b: /D') - os.system('subst b: "%s"' % GlobalData.gWORKSPACE) - GlobalData.gWORKSPACE =3D 'B:\\' - # End *********************************************** + Vol =3D 'B:' + for Index in range(90, 65, -1): + Vol =3D chr(Index) + ':' + if not os.path.isdir(Vol): + os.system('subst %s "%s"' % (Vol, GlobalData.gWORKSPACE)) + break + GlobalData.gWORKSPACE =3D '%s\\' % Vol =20 WorkspaceDir =3D GlobalData.gWORKSPACE =20 @@ -304,8 +305,9 @@ def Main(): except StandardError: Logger.Quiet(ST.MSG_RECOVER_FAIL) GlobalData.gDB.CloseDb() + if pf.system() =3D=3D 'Windows': - os.system('subst b: /D') + os.system('subst %s /D' %=20 + GlobalData.gWORKSPACE.replace('\\','')) =20 return ReturnCode =20 -- 2.7.2.windows.1