diff options
author | Yunhua Feng <yunhuax.feng@intel.com> | 2018-06-21 15:17:24 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-06-29 15:21:45 +0800 |
commit | 395f33368620e13b64f7f5c10fd1d87c7559a2fc (patch) | |
tree | 5ad879213f1406f673b457b407409ee84f2a0ee8 /BaseTools/Source/Python/Workspace/MetaDataTable.py | |
parent | cd7bd491f3f9c43e4bb6c9516784ef3a09b6e337 (diff) | |
download | edk2-395f33368620e13b64f7f5c10fd1d87c7559a2fc.tar.gz edk2-395f33368620e13b64f7f5c10fd1d87c7559a2fc.tar.bz2 edk2-395f33368620e13b64f7f5c10fd1d87c7559a2fc.zip |
BaseTools: Fix two drivers include the same file issue
Two drivers include the same PCD file, the PCD value in the first
driver is correct, but it in the second driver is incorrect.
DSC:
[Components]
Testpkg/Testdriver1.inf {
<PcdsFixedAtBuild>
!include Test.txt
}
Testpkg/Testdriver2.inf {
<PcdsFixedAtBuild>
!include Test.txt
}
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/MetaDataTable.py')
-rw-r--r-- | BaseTools/Source/Python/Workspace/MetaDataTable.py | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/Workspace/MetaDataTable.py b/BaseTools/Source/Python/Workspace/MetaDataTable.py index e37a10c82f..bd751eadfb 100644 --- a/BaseTools/Source/Python/Workspace/MetaDataTable.py +++ b/BaseTools/Source/Python/Workspace/MetaDataTable.py @@ -168,7 +168,8 @@ class TableFile(Table): Path VARCHAR,
FullPath VARCHAR NOT NULL,
Model INTEGER DEFAULT 0,
- TimeStamp SINGLE NOT NULL
+ TimeStamp SINGLE NOT NULL,
+ FromItem REAL NOT NULL
'''
def __init__(self, Cursor):
Table.__init__(self, Cursor, 'File')
@@ -184,7 +185,7 @@ class TableFile(Table): # @param Model: Model of a File
# @param TimeStamp: TimeStamp of a File
#
- def Insert(self, Name, ExtName, Path, FullPath, Model, TimeStamp):
+ def Insert(self, Name, ExtName, Path, FullPath, Model, TimeStamp, FromItem=0):
(Name, ExtName, Path, FullPath) = ConvertToSqlString((Name, ExtName, Path, FullPath))
return Table.Insert(
self,
@@ -193,7 +194,8 @@ class TableFile(Table): Path,
FullPath,
Model,
- TimeStamp
+ TimeStamp,
+ FromItem
)
## InsertFile
@@ -205,7 +207,17 @@ class TableFile(Table): #
# @retval FileID: The ID after record is inserted
#
- def InsertFile(self, File, Model):
+ def InsertFile(self, File, Model, FromItem=''):
+ if FromItem:
+ return self.Insert(
+ File.Name,
+ File.Ext,
+ File.Dir,
+ File.Path,
+ Model,
+ File.TimeStamp,
+ FromItem
+ )
return self.Insert(
File.Name,
File.Ext,
@@ -221,8 +233,11 @@ class TableFile(Table): #
# @retval ID ID value of given file in the table
#
- def GetFileId(self, File):
- QueryScript = "select ID from %s where FullPath = '%s'" % (self.Table, str(File))
+ def GetFileId(self, File, FromItem=None):
+ if FromItem:
+ QueryScript = "select ID from %s where FullPath = '%s' and FromItem = %s" % (self.Table, str(File), str(FromItem))
+ else:
+ QueryScript = "select ID from %s where FullPath = '%s'" % (self.Table, str(File))
RecordList = self.Exec(QueryScript)
if len(RecordList) == 0:
return None
|