]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Workspace/MetaFileTable.py
BaseTools: Fix a bug use 'COMMON' as CodeBase in BuildOptions section
[mirror_edk2.git] / BaseTools / Source / Python / Workspace / MetaFileTable.py
index ab1807046e49b25087f7105139741b6c8253319d..aedcacada199d094047e7c599630be88cabb0d54 100644 (file)
@@ -341,7 +341,13 @@ class PlatformTable(MetaFileTable):
         if Scope1 != None and Scope1 != 'COMMON':\r
             ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Scope1\r
         if Scope2 != None and Scope2 != 'COMMON':\r
-            ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Scope2\r
+            # Cover the case that CodeBase is 'COMMON' for BuildOptions section\r
+            if '.' in Scope2:\r
+                Index = Scope2.index('.')\r
+                NewScope = 'COMMON'+ Scope2[Index:]\r
+                ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT' OR Scope2='%s')" % (Scope2, NewScope)\r
+            else:\r
+                ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Scope2\r
 \r
         if BelongsToItem != None:\r
             ConditionString += " AND BelongsToItem=%s" % BelongsToItem\r