diff options
author | Yunhua Feng <yunhuax.feng@intel.com> | 2018-06-21 10:17:24 +0300 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-06-29 10:21:45 +0300 |
commit | 395f33368620e13b64f7f5c10fd1d87c7559a2fc (patch) | |
tree | 5ad879213f1406f673b457b407409ee84f2a0ee8 /BaseTools/Source/Python/Workspace/MetaFileTable.py | |
parent | cd7bd491f3f9c43e4bb6c9516784ef3a09b6e337 (diff) | |
download | edk2-395f33368620e13b64f7f5c10fd1d87c7559a2fc.tar.xz |
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/MetaFileTable.py')
-rw-r--r-- | BaseTools/Source/Python/Workspace/MetaFileTable.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/Workspace/MetaFileTable.py b/BaseTools/Source/Python/Workspace/MetaFileTable.py index 69b2c40e7f..f528c1ee66 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileTable.py +++ b/BaseTools/Source/Python/Workspace/MetaFileTable.py @@ -31,15 +31,15 @@ class MetaFileTable(Table): _ID_MAX_ = 0.99999999
## Constructor
- def __init__(self, Cursor, MetaFile, FileType, Temporary):
+ def __init__(self, Cursor, MetaFile, FileType, Temporary, FromItem=None):
self.MetaFile = MetaFile
self._FileIndexTable = TableFile(Cursor)
self._FileIndexTable.Create(False)
- FileId = self._FileIndexTable.GetFileId(MetaFile)
+ FileId = self._FileIndexTable.GetFileId(MetaFile, FromItem)
if not FileId:
- FileId = self._FileIndexTable.InsertFile(MetaFile, FileType)
+ FileId = self._FileIndexTable.InsertFile(MetaFile, FileType, FromItem)
if Temporary:
TableName = "_%s_%s_%s" % (FileType, FileId, uuid.uuid4().hex)
@@ -285,8 +285,8 @@ class PlatformTable(MetaFileTable): _DUMMY_ = "-1, -1, '====', '====', '====', '====', '====','====', -1, -1, -1, -1, -1, -1, -1"
## Constructor
- def __init__(self, Cursor, MetaFile, Temporary):
- MetaFileTable.__init__(self, Cursor, MetaFile, MODEL_FILE_DSC, Temporary)
+ def __init__(self, Cursor, MetaFile, Temporary, FromItem=0):
+ MetaFileTable.__init__(self, Cursor, MetaFile, MODEL_FILE_DSC, Temporary, FromItem)
## Insert table
#
@@ -379,7 +379,7 @@ class MetaFileStorage(object): }
## Constructor
- def __new__(Class, Cursor, MetaFile, FileType=None, Temporary=False):
+ def __new__(Class, Cursor, MetaFile, FileType=None, Temporary=False, FromItem=None):
# no type given, try to find one
if not FileType:
if MetaFile.Type in self._FILE_TYPE_:
@@ -392,6 +392,8 @@ class MetaFileStorage(object): Args = (Cursor, MetaFile, FileType, Temporary)
else:
Args = (Cursor, MetaFile, Temporary)
+ if FromItem:
+ Args = Args + (FromItem,)
# create the storage object and return it to caller
return Class._FILE_TABLE_[FileType](*Args)
|