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.93; helo=mga11.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org 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 94799210DA14C for ; Sun, 5 Aug 2018 18:02:29 -0700 (PDT) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Aug 2018 18:02:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,450,1526367600"; d="dat'59?scan'59,208,59";a="78733103" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga001.fm.intel.com with ESMTP; 05 Aug 2018 18:02:29 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 5 Aug 2018 18:02:28 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 5 Aug 2018 18:02:28 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.81]) with mapi id 14.03.0319.002; Mon, 6 Aug 2018 09:02:26 +0800 From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" CC: "Zhu, Yonghong" , "Gao, Liming" Thread-Topic: [PATCH] BaseTools: Use gGuidPattern for Guid regular expression Thread-Index: AdQtISMtCvdjONBkQFmSMqen9v1fCQ== Date: Mon, 6 Aug 2018 01:02:25 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC48AC6CA@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC48AC6CA@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: [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: Mon, 06 Aug 2018 01:02:29 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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.MultipleWorkspace import MultipleWorkspace as mws from . import FfsFileStatement import glob from struct import unpack +from Common.GlobalData import gGuidPattern =20 ## Version and Copyright versionNumber =3D "1.0" + ' ' + gBUILD_VERSION __version__ =3D "%prog Version " + versionNumber __copyright__ =3D "Copyright (c) 2007 - 2018, Intel Corporation All right= s 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: --=20 2.12.2.windows.2