From 8518bf0b92a78938341a2752a0044f04336668cc Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Fri, 22 Dec 2017 20:46:15 +0800 Subject: BaseTools: Support Structure PCD value inherit between the different SKUs https://bugzilla.tianocore.org/show_bug.cgi?id=543 Structure PCD field value can inherit between the different SKUIds. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C Reviewed-by: Liming Gao --- BaseTools/Source/Python/Workspace/MetaFileTable.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/MetaFileTable.py') diff --git a/BaseTools/Source/Python/Workspace/MetaFileTable.py b/BaseTools/Source/Python/Workspace/MetaFileTable.py index aedcacada1..d8549c9d66 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileTable.py +++ b/BaseTools/Source/Python/Workspace/MetaFileTable.py @@ -23,6 +23,7 @@ from MetaDataTable import Table, TableFile from MetaDataTable import ConvertToSqlString from CommonDataClass.DataClass import MODEL_FILE_DSC, MODEL_FILE_DEC, MODEL_FILE_INF, \ MODEL_FILE_OTHERS +from Common.DataType import * class MetaFileTable(Table): # TRICK: use file ID as the part before '.' @@ -271,6 +272,7 @@ class PlatformTable(MetaFileTable): Value3 TEXT, Scope1 TEXT, Scope2 TEXT, + Scope3 TEXT, BelongsToItem REAL NOT NULL, FromItem REAL NOT NULL, StartLine INTEGER NOT NULL, @@ -280,7 +282,7 @@ class PlatformTable(MetaFileTable): Enabled INTEGER DEFAULT 0 ''' # used as table end flag, in case the changes to database is not committed to db file - _DUMMY_ = "-1, -1, '====', '====', '====', '====', '====', -1, -1, -1, -1, -1, -1, -1" + _DUMMY_ = "-1, -1, '====', '====', '====', '====', '====','====', -1, -1, -1, -1, -1, -1, -1" ## Constructor def __init__(self, Cursor, MetaFile, Temporary): @@ -304,9 +306,9 @@ class PlatformTable(MetaFileTable): # @param EndColumn: EndColumn of a Dsc item # @param Enabled: If this item enabled # - def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON', BelongsToItem=-1, + def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON', Scope3=TAB_DEFAULT_STORES_DEFAULT,BelongsToItem=-1, FromItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=1): - (Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2)) + (Value1, Value2, Value3, Scope1, Scope2,Scope3) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2,Scope3)) return Table.Insert( self, Model, @@ -315,6 +317,7 @@ class PlatformTable(MetaFileTable): Value3, Scope1, Scope2, + Scope3, BelongsToItem, FromItem, StartLine, @@ -336,7 +339,7 @@ class PlatformTable(MetaFileTable): # def Query(self, Model, Scope1=None, Scope2=None, BelongsToItem=None, FromItem=None): ConditionString = "Model=%s AND Enabled>0" % Model - ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine" + ValueString = "Value1,Value2,Value3,Scope1,Scope2,Scope3,ID,StartLine" if Scope1 != None and Scope1 != 'COMMON': ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Scope1 -- cgit v1.2.3