def SetInfVersion(self, InfVersion, Comments):
        #
        # Value has been set before.
        #
        if self.InfVersion != None:
            ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
                       %(DT.TAB_INF_DEFINES_INF_VERSION),
                       LineInfo=self.CurrentLine)
            return False
        #
        # The InfVersion should be 4 bytes hex string.
        #
        if (IsValidHex(InfVersion)):
            if (InfVersion < '0x00010005'):
                ErrorInInf(ST.ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF,
                           ErrorCode=ToolError.EDK1_INF_ERROR,
                           LineInfo=self.CurrentLine)
        elif IsValidDecVersionVal(InfVersion):
            if (InfVersion < 65541):
                ErrorInInf(ST.ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF,
                           ErrorCode=ToolError.EDK1_INF_ERROR,
                           LineInfo=self.CurrentLine)
        else:
            ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (InfVersion),
                       LineInfo=self.CurrentLine)
            return False

        self.InfVersion = InfDefMember()
        self.InfVersion.SetValue(InfVersion)
        self.InfVersion.Comments = Comments
        return True
Beispiel #2
0
 def _SetDecSpecification(self, Token):
     if self.ItemObject.GetPackageSpecification():
         self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED % DT.TAB_DEC_DEFINES_DEC_SPECIFICATION)
     if not IsValidToken('0[xX][0-9a-fA-F]{8}', Token):
         if not IsValidDecVersionVal(Token):
             self._LoggerError(ST.ERR_DECPARSE_DEFINE_SPEC)
     self.ItemObject.SetPackageSpecification(Token)
 def SetPiSpecificationVersion(self, PiSpecificationVersion, Comments):
     #
     # Value has been set before.
     #
     if self.PiSpecificationVersion != None:
         ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
                    %(DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSION),
                    LineInfo=self.CurrentLine)
         return False
     #
     # The EdkReleaseVersion should be 4 bytes hex string.
     #
     if IsValidHexVersion(PiSpecificationVersion) or \
        IsValidDecVersionVal(PiSpecificationVersion):
         self.PiSpecificationVersion = InfDefMember()
         self.PiSpecificationVersion.SetValue(PiSpecificationVersion)
         self.PiSpecificationVersion.Comments = Comments
         return True
     else:
         ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID\
                    %(PiSpecificationVersion),
                    LineInfo=self.CurrentLine)
         return False
Beispiel #4
0
 def SetEdkReleaseVersion(self, EdkReleaseVersion, Comments):
     #
     # Value has been set before.
     #
     if self.EdkReleaseVersion is not None:
         ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
                    %(DT.TAB_INF_DEFINES_EDK_RELEASE_VERSION),
                    LineInfo=self.CurrentLine)
         return False
     #
     # The EdkReleaseVersion should be 4 bytes hex string.
     #
     if IsValidHexVersion(EdkReleaseVersion) or \
        IsValidDecVersionVal(EdkReleaseVersion):
         self.EdkReleaseVersion = InfDefMember()
         self.EdkReleaseVersion.SetValue(EdkReleaseVersion)
         self.EdkReleaseVersion.Comments = Comments
         return True
     else:
         ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID\
                    %(EdkReleaseVersion),
                    LineInfo=self.CurrentLine)
         return False