summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Workspace/MetaFileParser.py
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/Workspace/MetaFileParser.py')
-rw-r--r--BaseTools/Source/Python/Workspace/MetaFileParser.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 3c7d7fdf6a..2b25dc42ae 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -503,6 +503,13 @@ class InfParser(MetaFileParser):
EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
File=self.MetaFile, Line=self._LineIndex+1)
+ # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
+ if self._ValueList[2] != '':
+ InfPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
+ if InfPcdValueList[0] in ['True', 'true', 'TRUE']:
+ self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '1', 1);
+ elif InfPcdValueList[0] in ['False', 'false', 'FALSE']:
+ self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '0', 1);
## [depex] section parser
def _DepexParser(self):
@@ -929,7 +936,13 @@ class DscParser(MetaFileParser):
EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given",
ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
File=self.MetaFile, Line=self._LineIndex+1)
-
+ # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
+ DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
+ if DscPcdValueList[0] in ['True', 'true', 'TRUE']:
+ self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '1', 1);
+ elif DscPcdValueList[0] in ['False', 'false', 'FALSE']:
+ self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '0', 1);
+
## [components] section parser
def _ComponentParser(self):
if self._CurrentLine[-1] == '{':
@@ -1226,6 +1239,10 @@ class DecParser(MetaFileParser):
if not IsValid:
EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=self._CurrentLine,
File=self.MetaFile, Line=self._LineIndex+1)
+ if ValueList[0] in ['True', 'true', 'TRUE']:
+ ValueList[0] = '1'
+ elif ValueList[0] in ['False', 'false', 'FALSE']:
+ ValueList[0] = '0'
self._ValueList[2] = ValueList[0].strip() + '|' + ValueList[1].strip() + '|' + ValueList[2].strip()