]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/DepexSection.py
Sync EDKII BaseTools to BaseTools project r1971
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / DepexSection.py
index a0a1905dfae1ce914e784effe6659999a2fee6e4..39678b23e96df52752caeedb2aa0e5cddcc036aa 100644 (file)
@@ -1,9 +1,9 @@
 ## @file\r
 # process depex section generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation\r
+#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
 #\r
-#  All rights reserved. This program and the accompanying materials\r
+#  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
 #  http://opensource.org/licenses/bsd-license.php\r
@@ -62,24 +62,27 @@ class DepexSection (DepexSectionClassObject):
     #   @retval tuple       (Generated file name list, section alignment)\r
     #\r
     def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}):\r
+        \r
+        if self.ExpressionProcessed == False:\r
+            self.Expression = self.Expression.replace("\n", " ").replace("\r", " ")\r
+            ExpList = self.Expression.split()\r
+            ExpGuidDict = {}\r
 \r
-        self.Expression = self.Expression.replace("\n", " ").replace("\r", " ")\r
-        ExpList = self.Expression.split()\r
-        ExpGuidDict = {}\r
+            for Exp in ExpList:\r
+                if Exp.upper() not in ('AND', 'OR', 'NOT', 'TRUE', 'FALSE', 'SOR', 'BEFORE', 'AFTER', 'END'):\r
+                    GuidStr = self.__FindGuidValue(Exp)\r
+                    if GuidStr == None:\r
+                        EdkLogger.error("GenFds", RESOURCE_NOT_AVAILABLE,\r
+                                        "Depex GUID %s could not be found in build DB! (ModuleName: %s)" % (Exp, ModuleName))\r
 \r
-        for Exp in ExpList:\r
-            if Exp.upper() not in ('AND', 'OR', 'NOT', 'TRUE', 'FALSE', 'SOR', 'BEFORE', 'AFTER', 'END'):\r
-                GuidStr = self.__FindGuidValue(Exp)\r
-                if GuidStr == None:\r
-                    EdkLogger.error("GenFds", RESOURCE_NOT_AVAILABLE,\r
-                                    "Depex GUID %s could not be found in build DB! (ModuleName: %s)" % (Exp, ModuleName))\r
+                    ExpGuidDict[Exp] = GuidStr\r
 \r
-                ExpGuidDict[Exp] = GuidStr\r
+            for Item in ExpGuidDict:\r
+                self.Expression = self.Expression.replace(Item, ExpGuidDict[Item])\r
 \r
-        for Item in ExpGuidDict:\r
-            self.Expression = self.Expression.replace(Item, ExpGuidDict[Item])\r
+            self.Expression = self.Expression.strip()\r
+            self.ExpressionProcessed = True\r
 \r
-        self.Expression = self.Expression.strip()\r
         if self.DepexType == 'PEI_DEPEX_EXP':\r
             ModuleType = 'PEIM'\r
             SecType    = 'PEI_DEPEX'\r