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 0BCCA22333761 for ; Mon, 22 Jan 2018 17:55:44 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2018 18:01:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,398,1511856000"; d="scan'208";a="25516567" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 22 Jan 2018 18:01:11 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 22 Jan 2018 18:01:10 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 22 Jan 2018 18:01:10 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by shsmsx102.ccr.corp.intel.com ([169.254.2.189]) with mapi id 14.03.0319.002; Tue, 23 Jan 2018 10:01:08 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Add DefaultStore section format Check Thread-Index: AQHTk0ST8HYWJNSrtkaF77sG7lfq/6OAtYRA Date: Tue, 23 Jan 2018 02:01:08 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1AA96B@SHSMSX104.ccr.corp.intel.com> References: <1516600077-8784-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1516600077-8784-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Add DefaultStore section format Check X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2018 01:55:45 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yo= nghong Zhu > Sent: Monday, January 22, 2018 1:48 PM > To: edk2-devel@lists.01.org > Subject: [edk2] [Patch] BaseTools: Add DefaultStore section format Check >=20 > This patch add DefaultStore section format Check and it use same logic > with SKUID section. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Yonghong Zhu > --- > BaseTools/Source/Python/Workspace/DscBuildData.py | 8 ++++++++ > BaseTools/Source/Python/Workspace/MetaFileParser.py | 2 +- > 2 files changed, 9 insertions(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTool= s/Source/Python/Workspace/DscBuildData.py > index 752fe05..16fe608 100644 > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > @@ -606,10 +606,18 @@ class DscBuildData(PlatformBuildClassObject): > EdkLogger.error('build', FORMAT_INVALID, 'No Default= Stores ID number', > File=3Dself.MetaFile, Line=3DRecord[= -1]) > if Record[1] in [None, '']: > EdkLogger.error('build', FORMAT_INVALID, 'No Default= Stores ID name', > File=3Dself.MetaFile, Line=3DRecord[= -1]) > + Pattern =3D re.compile('^[1-9]\d*|0$') > + HexPattern =3D re.compile(r'0[xX][0-9a-fA-F]+$') > + if Pattern.match(Record[0]) =3D=3D None and HexPattern.m= atch(Record[0]) =3D=3D None: > + EdkLogger.error('build', FORMAT_INVALID, "The format= of the DefaultStores ID number is invalid. It only > support Integer and HexNumber", > + File=3Dself.MetaFile, Line=3DRecord[= -1]) > + if not IsValidWord(Record[1]): > + EdkLogger.error('build', FORMAT_INVALID, "The format= of the DefaultStores ID name is invalid. The correct > format is '(a-zA-Z0-9_)(a-zA-Z0-9_-.)*'", > + File=3Dself.MetaFile, Line=3DRecord[= -1]) > self.DefaultStores[Record[1].upper()] =3D (self.ToInt(Re= cord[0]),Record[1].upper()) > if TAB_DEFAULT_STORES_DEFAULT not in self.DefaultStores: > self.DefaultStores[TAB_DEFAULT_STORES_DEFAULT] =3D (0,TA= B_DEFAULT_STORES_DEFAULT) > GlobalData.gDefaultStores =3D self.DefaultStores.keys() > if GlobalData.gDefaultStores: > diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTo= ols/Source/Python/Workspace/MetaFileParser.py > index e236732..202093a 100644 > --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py > +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py > @@ -1103,11 +1103,11 @@ class DscParser(MetaFileParser): > self._ValueList[0:len(TokenList)] =3D TokenList > @ParseMacro > def _DefaultStoresParser(self): > TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPL= IT) > if len(TokenList) !=3D 2: > - EdkLogger.error('Parser', FORMAT_INVALID, "Correct format is= '|'", > + EdkLogger.error('Parser', FORMAT_INVALID, "Correct format is= '|'", > ExtraData=3Dself._CurrentLine, File=3Dself.M= etaFile, Line=3Dself._LineIndex + 1) > self._ValueList[0:len(TokenList)] =3D TokenList >=20 > ## Parse Edk style of library modules > @ParseMacro > -- > 2.6.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel