Revision: 19075
          http://sourceforge.net/p/edk2/code/19075
Author:   vanjeff
Date:     2015-12-01 02:31:16 +0000 (Tue, 01 Dec 2015)
Log Message:
-----------
BaseTool/UPT: Add supporting of decimal numbers for INF_VERSION and 
DEC_SPECIFICATION

(Sync patch r18868 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <[email protected]>
Reviewed-by: Yonghong Zhu <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18868

Modified Paths:
--------------
    branches/UDK2015/BaseTools/Source/Python/UPT/Logger/StringTable.py
    
branches/UDK2015/BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py
    branches/UDK2015/BaseTools/Source/Python/UPT/Parser/DecParser.py

Modified: branches/UDK2015/BaseTools/Source/Python/UPT/Logger/StringTable.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/UPT/Logger/StringTable.py  
2015-12-01 02:30:36 UTC (rev 19074)
+++ branches/UDK2015/BaseTools/Source/Python/UPT/Logger/StringTable.py  
2015-12-01 02:31:16 UTC (rev 19075)
@@ -656,7 +656,7 @@
 ERR_DECPARSE_DEFINE_UNKNOWKEY       = \
 _("Unknown key [%s] in define section.")
 ERR_DECPARSE_DEFINE_SPEC            = \
-_("Specification value must be HEX numbers.")
+_("Specification value must be HEX numbers or decimal numbers.")
 ERR_DECPARSE_DEFINE_PKGNAME         = \
 _("Package name must be AlphaNumeric characters.")
 ERR_DECPARSE_DEFINE_PKGGUID         = \

Modified: 
branches/UDK2015/BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py
===================================================================
--- 
branches/UDK2015/BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py   
    2015-12-01 02:30:36 UTC (rev 19074)
+++ 
branches/UDK2015/BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py   
    2015-12-01 02:31:16 UTC (rev 19075)
@@ -340,16 +340,21 @@
                 ErrorInInf(ST.ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF,
                            ErrorCode=ToolError.EDK1_INF_ERROR,
                            LineInfo=self.CurrentLine)
-                
-            self.InfVersion = InfDefMember()
-            self.InfVersion.SetValue(InfVersion)
-            self.InfVersion.Comments = Comments          
-            return True
+        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
+
     ## GetInfVersion
     #                     
     def GetInfVersion(self):
@@ -1000,4 +1005,4 @@
     
     def GetDefines(self):
         return self.Defines                      
-        
\ No newline at end of file
+        

Modified: branches/UDK2015/BaseTools/Source/Python/UPT/Parser/DecParser.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/UPT/Parser/DecParser.py    
2015-12-01 02:30:36 UTC (rev 19074)
+++ branches/UDK2015/BaseTools/Source/Python/UPT/Parser/DecParser.py    
2015-12-01 02:31:16 UTC (rev 19075)
@@ -29,6 +29,7 @@
 from Library.ParserValidate import IsValidUserId
 from Library.ParserValidate import IsValidArch
 from Library.ParserValidate import IsValidWord
+from Library.ParserValidate import IsValidDecVersionVal
 from Parser.DecParserMisc import TOOL_NAME
 from Parser.DecParserMisc import CleanString
 from Parser.DecParserMisc import IsValidPcdDatum
@@ -452,7 +453,8 @@
         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):
-            self._LoggerError(ST.ERR_DECPARSE_DEFINE_SPEC)
+            if not IsValidDecVersionVal(Token):
+                self._LoggerError(ST.ERR_DECPARSE_DEFINE_SPEC)
         self.ItemObject.SetPackageSpecification(Token)
     
     def _SetPackageName(self, Token):


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to