From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 356B321CAD998 for ; Tue, 7 Aug 2018 17:48:50 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2018 17:48:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,456,1526367600"; d="scan'208";a="73595557" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 07 Aug 2018 17:48:49 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 7 Aug 2018 17:48:49 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 7 Aug 2018 17:48:48 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.150]) with mapi id 14.03.0319.002; Wed, 8 Aug 2018 08:48:47 +0800 From: "Zhu, Yonghong" To: "Feng, YunhuaX" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH] BaseTools: Use gGuidPattern for Guid regular expression Thread-Index: AdQtISMtCvdjONBkQFmSMqen9v1fCQBkGtPg Date: Wed, 8 Aug 2018 00:48:47 +0000 Message-ID: References: <47C64442C08CCD4089DC43B6B5E46BC48AC6CA@shsmsx102.ccr.corp.intel.com> In-Reply-To: <47C64442C08CCD4089DC43B6B5E46BC48AC6CA@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: Use gGuidPattern for Guid regular expression 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: Wed, 08 Aug 2018 00:48:50 -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: Feng, YunhuaX=20 Sent: Monday, August 06, 2018 9:02 AM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong ; Gao, Liming Subject: [PATCH] BaseTools: Use gGuidPattern for Guid regular expression Use GlobalData.py gGuidPattern for Guid regular expression Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/GenFds/GenFds.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Py= thon/GenFds/GenFds.py index 156aae1d0e..2307a19cbe 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -42,10 +42,11 @@ from Common.Misc import GuidStructureStringToGuidString= from Common.BuildVersion import gBUILD_VERSION from Common.MultipleWorks= pace import MultipleWorkspace as mws from . import FfsFileStatement impor= t glob from struct import unpack +from Common.GlobalData import gGuidPattern =20 ## Version and Copyright versionNumber =3D "1.0" + ' ' + gBUILD_VERSION __version__ =3D "%prog Ver= sion " + versionNumber __copyright__ =3D "Copyright (c) 2007 - 2018, Intel= Corporation All rights reserved." @@ -603,15 +604,11 @@ class GenFds : GuidXRefFileName =3D os.path.join(GenFdsGlobalVariable.FvDir, "Gui= d.xref") GuidXRefFile =3D BytesIO('') GuidDict =3D {} ModuleList =3D [] FileGuidList =3D [] - GuidPattern =3D re.compile("\s*([0-9a-fA-F]){8}-" - "([0-9a-fA-F]){4}-" - "([0-9a-fA-F]){4}-" - "([0-9a-fA-F]){4}-" - "([0-9a-fA-F]){12}\s*") + GuidPattern =3D gGuidPattern for Arch in ArchList: PlatformDataBase =3D BuildDb.BuildObject[GenFdsGlobalVariable.= ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable= .ToolChainTag] for ModuleFile in PlatformDataBase.Modules: Module =3D BuildDb.BuildObject[ModuleFile, Arch, GenFdsGlo= balVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] if Module in ModuleList: -- 2.12.2.windows.2