]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/UPT: Fix a parser issue
authorHess Chen <hesheng.chen@intel.com>
Sat, 1 Apr 2017 05:33:05 +0000 (13:33 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Wed, 5 Apr 2017 02:46:19 +0000 (10:46 +0800)
Update the method to get PCD information and support empty section.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py

index bb8a1206b17e1a98317e547f9b23de9f845d196e..a376f56fcfa80fc0d162e73402bc553f8b0dc187 100644 (file)
@@ -568,8 +568,9 @@ def GenUserExtensions(ModuleObject):
         if UserExtension.GetIdentifier() == 'Depex':\r
             continue\r
         Statement = UserExtension.GetStatement()\r
-        if not Statement:\r
-            continue\r
+# Comment the code to support user extension without any statement just the section header in []\r
+#         if not Statement:\r
+#             continue\r
         ArchList = UserExtension.GetSupArchList()\r
         for Index in xrange(0, len(ArchList)):\r
             ArchList[Index] = ConvertArchForInstall(ArchList[Index])\r
index 0a8624c67fafebeed26905d66e28909318b85d3a..3c6c9ee2907e7dc0cd7244fc2595daf146b0b78c 100644 (file)
@@ -2,7 +2,7 @@
 #\r
 # This file contained the miscellaneous routines for GenMetaFile usage.\r
 #\r
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available \r
 # under the terms and conditions of the BSD License which accompanies this \r
@@ -108,33 +108,28 @@ def ObtainPcdName(Packages, TokenSpaceGuidValue, Token):
         TokenSpaceGuidName = ''\r
         PcdCName = ''\r
         TokenSpaceGuidNameFound = False\r
-        PcdCNameFound = False\r
 \r
         #\r
         # Get TokenSpaceGuidCName from Guids section \r
         #\r
         for GuidKey in DecGuidsDict:\r
             GuidList = DecGuidsDict[GuidKey]\r
-            if TokenSpaceGuidNameFound:\r
-                break\r
             for GuidItem in GuidList:\r
                 if TokenSpaceGuidValue.upper() == GuidItem.GuidString.upper():\r
                     TokenSpaceGuidName = GuidItem.GuidCName\r
                     TokenSpaceGuidNameFound = True\r
                     break\r
-\r
+            if TokenSpaceGuidNameFound:\r
+                break\r
         #\r
         # Retrieve PcdCName from Pcds Section\r
         #\r
         for PcdKey in DecPcdsDict:\r
             PcdList = DecPcdsDict[PcdKey]\r
-            if PcdCNameFound:\r
-                return TokenSpaceGuidName, PcdCName\r
             for PcdItem in PcdList:\r
                 if TokenSpaceGuidName == PcdItem.TokenSpaceGuidCName and Token == PcdItem.TokenValue:\r
                     PcdCName = PcdItem.TokenCName\r
-                    PcdCNameFound = True\r
-                    break\r
+                    return TokenSpaceGuidName, PcdCName\r
 \r
     return TokenSpaceGuidName, PcdCName\r
 \r