summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenDepex.py9
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py23
-rw-r--r--BaseTools/Source/Python/GenFds/GuidSection.py21
3 files changed, 40 insertions, 13 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source/Python/AutoGen/GenDepex.py
index b652051ac1..f80824b744 100644
--- a/BaseTools/Source/Python/AutoGen/GenDepex.py
+++ b/BaseTools/Source/Python/AutoGen/GenDepex.py
@@ -423,7 +423,14 @@ def Main():
Dpx = DependencyExpression(DxsString, Option.ModuleType, Option.Optimize)
if Option.OutputFile != None:
- Dpx.Generate(Option.OutputFile)
+ FileChangeFlag = Dpx.Generate(Option.OutputFile)
+ if not FileChangeFlag and DxsFile:
+ #
+ # Touch the output file if its time stamp is older than the original
+ # DXS file to avoid re-invoke this tool for the dependency check in build rule.
+ #
+ if os.stat(DxsFile)[8] > os.stat(Option.OutputFile)[8]:
+ os.utime(Option.OutputFile, None)
else:
Dpx.Generate()
except BaseException, X:
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 69a4898499..c4358cf479 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -43,6 +43,8 @@ import OptRomFileStatement
from GenFdsGlobalVariable import GenFdsGlobalVariable
from Common.BuildToolError import *
from Common import EdkLogger
+from Common.Misc import PathClass
+from Common.String import NormPath
import re
import os
@@ -205,6 +207,8 @@ class FdfParser:
self.__SkippedChars = ""
self.__WipeOffArea = []
+ if GenFdsGlobalVariable.WorkSpaceDir == '':
+ GenFdsGlobalVariable.WorkSpaceDir = os.getenv("WORKSPACE")
## __IsWhiteSpace() method
#
@@ -2145,6 +2149,11 @@ class FdfParser:
if not self.__GetNextToken():
raise Warning("expected INF file path", self.FileName, self.CurrentLineNumber)
ffsInf.InfFileName = self.__Token
+ if ffsInf.InfFileName.replace('$(WORKSPACE)', '').find('$') == -1:
+ #do case sensitive check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(ffsInf.InfFileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
if not ffsInf.InfFileName in self.Profile.InfList:
self.Profile.InfList.append(ffsInf.InfFileName)
@@ -2352,6 +2361,11 @@ class FdfParser:
self.__GetSectionData( FfsFileObj, MacroDict)
else:
FfsFileObj.FileName = self.__Token
+ if FfsFileObj.FileName.replace('$(WORKSPACE)', '').find('$') == -1:
+ #do case sensitive check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
if not self.__IsToken( "}"):
raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
@@ -2597,6 +2611,11 @@ class FdfParser:
if not self.__GetNextToken():
raise Warning("expected section file path", self.FileName, self.CurrentLineNumber)
DataSectionObj.SectFileName = self.__Token
+ if DataSectionObj.SectFileName.replace('$(WORKSPACE)', '').find('$') == -1:
+ #do case sensitive check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(DataSectionObj.SectFileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
else:
if not self.__GetCglSection(DataSectionObj):
return False
@@ -2684,8 +2703,8 @@ class FdfParser:
def __GetGuidAttrib(self):
AttribDict = {}
- AttribDict["PROCESSING_REQUIRED"] = False
- AttribDict["AUTH_STATUS_VALID"] = False
+ AttribDict["PROCESSING_REQUIRED"] = "NONE"
+ AttribDict["AUTH_STATUS_VALID"] = "NONE"
if self.__IsKeyword("PROCESSING_REQUIRED") or self.__IsKeyword("AUTH_STATUS_VALID"):
AttribKey = self.__Token
diff --git a/BaseTools/Source/Python/GenFds/GuidSection.py b/BaseTools/Source/Python/GenFds/GuidSection.py
index 0ef5a23716..bd95f56720 100644
--- a/BaseTools/Source/Python/GenFds/GuidSection.py
+++ b/BaseTools/Source/Python/GenFds/GuidSection.py
@@ -193,16 +193,17 @@ class GuidSection(GuidSectionClassObject) :
Attribute = []
HeaderLength = None
- if TempFileSize > InputFileSize and TempFileSize % 4 == 0:
- FileHandleIn.seek(0)
- BufferIn = FileHandleIn.read()
- FileHandleOut.seek(0)
- BufferOut = FileHandleOut.read()
- if BufferIn == BufferOut[TempFileSize - InputFileSize:]:
- HeaderLength = str(TempFileSize - InputFileSize)
- #auto sec guided attribute with process required
- if HeaderLength == None:
- Attribute.append('PROCESSING_REQUIRED')
+ if self.ProcessRequired == "NONE":
+ if TempFileSize > InputFileSize and TempFileSize % 4 == 0:
+ FileHandleIn.seek(0)
+ BufferIn = FileHandleIn.read()
+ FileHandleOut.seek(0)
+ BufferOut = FileHandleOut.read()
+ if BufferIn == BufferOut[TempFileSize - InputFileSize:]:
+ HeaderLength = str(TempFileSize - InputFileSize)
+ #auto sec guided attribute with process required
+ if HeaderLength == None:
+ Attribute.append('PROCESSING_REQUIRED')
FileHandleIn.close()
FileHandleOut.close()