From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ml01.01.org (Postfix) with ESMTP id 6A8F71A1E05 for ; Thu, 18 Aug 2016 22:27:00 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 18 Aug 2016 22:27:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,543,1464678000"; d="scan'208";a="1017131130" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 18 Aug 2016 22:26:59 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 18 Aug 2016 22:26:58 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 18 Aug 2016 22:26:58 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.116]) with mapi id 14.03.0248.002; Fri, 19 Aug 2016 13:26:56 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Fix a bug use 'COMMON' as CodeBase in BuildOptions section Thread-Index: AQHR+HgTBXY0ktPEcEK/5T+OSvPijKBPw5jA Date: Fri, 19 Aug 2016 05:26:55 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A1155ECE4D@shsmsx102.ccr.corp.intel.com> References: <1471432242-97696-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1471432242-97696-1-git-send-email-yonghong.zhu@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 a bug use 'COMMON' as CodeBase in BuildOptions section 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: Fri, 19 Aug 2016 05:27:00 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Zhu, Yonghong > Sent: Wednesday, August 17, 2016 7:11 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming ; Kurt Kennett > > Subject: [Patch] BaseTools: Fix a bug use 'COMMON' as CodeBase in > BuildOptions section >=20 > Current BaseTools query the BuildOptions not cover the case that use > 'COMMON' as CodeBase, while DSC spec allow this usage. This Patch add > support for such 'common.DXE_RUNTIME_DRIVER' as the Scope2 in the > query > Condition. >=20 > Cc: Liming Gao > Cc: Kurt Kennett > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Yonghong Zhu > --- > BaseTools/Source/Python/Workspace/MetaFileTable.py | 8 +++++++- > BaseTools/Source/Python/Workspace/WorkspaceDatabase.py | 3 ++- > 2 files changed, 9 insertions(+), 2 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/Workspace/MetaFileTable.py > b/BaseTools/Source/Python/Workspace/MetaFileTable.py > index ab18070..aedcaca 100644 > --- a/BaseTools/Source/Python/Workspace/MetaFileTable.py > +++ b/BaseTools/Source/Python/Workspace/MetaFileTable.py > @@ -339,11 +339,17 @@ class PlatformTable(MetaFileTable): > ValueString =3D "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine= " >=20 > if Scope1 !=3D None and Scope1 !=3D 'COMMON': > ConditionString +=3D " AND (Scope1=3D'%s' OR Scope1=3D'COMMO= N')" % > Scope1 > if Scope2 !=3D None and Scope2 !=3D 'COMMON': > - ConditionString +=3D " AND (Scope2=3D'%s' OR Scope2=3D'COMMO= N' OR > Scope2=3D'DEFAULT')" % Scope2 > + # Cover the case that CodeBase is 'COMMON' for BuildOptions > section > + if '.' in Scope2: > + Index =3D Scope2.index('.') > + NewScope =3D 'COMMON'+ Scope2[Index:] > + ConditionString +=3D " AND (Scope2=3D'%s' OR Scope2=3D'C= OMMON' OR > Scope2=3D'DEFAULT' OR Scope2=3D'%s')" % (Scope2, NewScope) > + else: > + ConditionString +=3D " AND (Scope2=3D'%s' OR Scope2=3D'C= OMMON' OR > Scope2=3D'DEFAULT')" % Scope2 >=20 > if BelongsToItem !=3D None: > ConditionString +=3D " AND BelongsToItem=3D%s" % BelongsToIt= em > else: > ConditionString +=3D " AND BelongsToItem<0" > diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py > b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py > index 86d8c32..ceaa4b8 100644 > --- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py > +++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py > @@ -800,13 +800,14 @@ class DscBuildData(PlatformBuildClassObject): > self._ModuleTypeOptions =3D sdict() > if (Edk, ModuleType) not in self._ModuleTypeOptions: > options =3D sdict() > self._ModuleTypeOptions[Edk, ModuleType] =3D options > DriverType =3D '%s.%s' % (Edk, ModuleType) > + CommonDriverType =3D '%s.%s' % ('COMMON', ModuleType) > RecordList =3D self._RawData[MODEL_META_DATA_BUILD_OPTION, > self._Arch, DriverType] > for ToolChainFamily, ToolChain, Option, Arch, Type, Dummy3, > Dummy4 in RecordList: > - if Type =3D=3D DriverType: > + if Type =3D=3D DriverType or Type =3D=3D CommonDriverTyp= e: > Key =3D (ToolChainFamily, ToolChain, Edk) > if Key not in options or not ToolChain.endswith('_FL= AGS') or > Option.startswith('=3D'): > options[Key] =3D Option > else: > options[Key] +=3D ' ' + Option > -- > 2.6.1.windows.1