Skip to content

Commit

Permalink
BaseTools: Remove the file timestamp checking during parsing
Browse files Browse the repository at this point in the history
During build, the meta files are not changed, so it's no need
to check file timestamp.

This patch is to remove useless logic.

Signed-off-by: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>

Reviewed-by: Liming Gao <[email protected]>
  • Loading branch information
BobCF authored and mergify[bot] committed Jul 21, 2020
1 parent 210b29f commit b3ee616
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
12 changes: 2 additions & 10 deletions BaseTools/Source/Python/Workspace/MetaFileTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,17 @@ def __init__(self, DB, MetaFile, FileType, Temporary, FromItem=None):
self.TableName = "_%s_%s" % (FileType, len(DB.TblFile))

def IsIntegrity(self):
Result = False
try:
TimeStamp = self.MetaFile.TimeStamp
if not self.CurrentContent:
Result = False
else:
Result = self.CurrentContent[-1][0] < 0
if not Result:
# update the timestamp in database
self.DB.SetFileTimeStamp(self.FileId, TimeStamp)
return False

if TimeStamp != self.DB.GetFileTimeStamp(self.FileId):
# update the timestamp in database
self.DB.SetFileTimeStamp(self.FileId, TimeStamp)
return False
except Exception as Exc:
EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc))
return False
return True
return Result

def SetEndFlag(self):
self.CurrentContent.append(self._DUMMY_)
Expand Down
16 changes: 0 additions & 16 deletions BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,6 @@ def __init__(self):
self.BuildObject = WorkspaceDatabase.BuildObjectFactory(self)
self.TransformObject = WorkspaceDatabase.TransformObjectFactory(self)

def SetFileTimeStamp(self,FileId,TimeStamp):
self.TblFile[FileId-1][6] = TimeStamp

def GetFileTimeStamp(self,FileId):
return self.TblFile[FileId-1][6]


## Summarize all packages in the database
def GetPackageList(self, Platform, Arch, TargetName, ToolChainTag):
Expand Down Expand Up @@ -193,16 +187,6 @@ def GetPackageList(self, Platform, Arch, TargetName, ToolChainTag):

return PackageList

## Summarize all platforms in the database
def PlatformList(self):
RetVal = []
for PlatformFile in [item[3] for item in self.TblFile if item[5] == MODEL_FILE_DSC]:
try:
RetVal.append(self.BuildObject[PathClass(PlatformFile), TAB_COMMON])
except:
pass
return RetVal

def MapPlatform(self, Dscfile):
Platform = self.BuildObject[PathClass(Dscfile), TAB_COMMON]
if Platform is None:
Expand Down

0 comments on commit b3ee616

Please sign in to comment.