From 14c48571ae607277d11132c5e085d3ec1f12d236 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Wed, 21 Jul 2010 02:46:15 +0000 Subject: Sync EDKII BaseTools to BaseTools project r1997 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10680 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/GenFds/FdfParser.py | 23 +++++++++++++++++++++-- BaseTools/Source/Python/GenFds/GuidSection.py | 21 +++++++++++---------- 2 files changed, 32 insertions(+), 12 deletions(-) (limited to 'BaseTools/Source/Python/GenFds') 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() -- cgit v1.2.3