]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/FdfParser.py
BaseTools: Fix a bug for --pcd used in ConditionalStatement calculate
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / FdfParser.py
index b95afc778362f1f2d43efe19205e2992481c8d22..dda7ed4ce79867d9131aa13930f4ec5fe7b10a9e 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # parse FDF file\r
 #\r
-#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #  Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>\r
 #\r
 #  This program and the accompanying materials\r
@@ -925,6 +925,13 @@ class FdfParser:
 \r
         MacroDict.update(GlobalData.gGlobalDefines)\r
         MacroDict.update(GlobalData.gCommandLineDefines)\r
+        if GlobalData.BuildOptionPcd:\r
+            for Item in GlobalData.BuildOptionPcd:\r
+                if type(Item) is tuple:\r
+                    continue\r
+                PcdName, TmpValue = Item.split("=")\r
+                TmpValue = BuildOptionValue(TmpValue, {})\r
+                MacroDict[PcdName.strip()] = TmpValue\r
         # Highest priority\r
 \r
         return MacroDict\r
@@ -2365,7 +2372,7 @@ class FdfParser:
 \r
     def __GetFvExtEntryStatement(self, FvObj):\r
 \r
-        if not self.__IsKeyword( "FV_EXT_ENTRY"):\r
+        if not (self.__IsKeyword( "FV_EXT_ENTRY") or self.__IsKeyword( "FV_EXT_ENTRY_TYPE")):\r
             return False\r
 \r
         if not self.__IsKeyword ("TYPE"):\r
@@ -2486,6 +2493,8 @@ class FdfParser:
         if not self.__GetNextToken():\r
             raise Warning("expected INF file path", self.FileName, self.CurrentLineNumber)\r
         ffsInf.InfFileName = self.__Token\r
+        if not ffsInf.InfFileName.endswith('.inf'):\r
+            raise Warning("expected .inf file path", self.FileName, self.CurrentLineNumber)\r
 \r
         ffsInf.CurrentLineNum = self.CurrentLineNumber\r
         ffsInf.CurrentLineContent = self.__CurrentLine()\r