From: Liming Gao Date: Tue, 19 Dec 2017 08:01:38 +0000 (+0800) Subject: BaseTools: Support nest field name in DSC/DEC X-Git-Tag: edk2-stable201903~2753 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=a09395932d997d41f59ae3ee2f7f77f91f5caa02;hp=520365decb26e5176ec2bb614f11ddeaa495de54 BaseTools: Support nest field name in DSC/DEC Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C Reviewed-by: Liming Gao --- diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 23c2c0d410..4642e761b9 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1207,18 +1207,19 @@ class DscBuildData(PlatformBuildClassObject): def get_length(value): Value = value.strip() - if Value.startswith('GUID') and Value.endswith(')'): - return 16 - if Value.startswith('L"') and Value.endswith('"'): - return len(Value[2:-1]) - if Value[0] == '"' and Value[-1] == '"': - return len(Value) - 2 - if Value[0] == '{' and Value[-1] == '}': - return len(Value.split(",")) - if Value.startswith("L'") and Value.endswith("'") and len(list(Value[2:-1])) > 1: - return len(list(Value[2:-1])) - if Value[0] == "'" and Value[-1] == "'" and len(list(Value[1:-1])) > 1: - return len(Value) - 2 + if len(value) > 1: + if Value.startswith('GUID') and Value.endswith(')'): + return 16 + if Value.startswith('L"') and Value.endswith('"'): + return len(Value[2:-1]) + if Value[0] == '"' and Value[-1] == '"': + return len(Value) - 2 + if Value[0] == '{' and Value[-1] == '}': + return len(Value.split(",")) + if Value.startswith("L'") and Value.endswith("'") and len(list(Value[2:-1])) > 1: + return len(list(Value[2:-1])) + if Value[0] == "'" and Value[-1] == "'" and len(list(Value[1:-1])) > 1: + return len(Value) - 2 return len(Value) return str(max([pcd_size for pcd_size in [get_length(item) for item in sku_values]])) diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index 6fa008ef65..3038447850 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1136,6 +1136,8 @@ class DscParser(MetaFileParser): self._ValueList[0], self._ValueList[1] = PcdNameTockens[0], PcdNameTockens[1] elif len(PcdNameTockens) == 3: self._ValueList[0], self._ValueList[1] = ".".join((PcdNameTockens[0], PcdNameTockens[1])), PcdNameTockens[2] + elif len(PcdNameTockens) > 3: + self._ValueList[0], self._ValueList[1] = ".".join((PcdNameTockens[0], PcdNameTockens[1])), ".".join(PcdNameTockens[2:]) if len(TokenList) == 2: self._ValueList[2] = TokenList[1] if self._ValueList[0] == '' or self._ValueList[1] == '': @@ -1910,7 +1912,7 @@ class DecParser(MetaFileParser): if len(PcdNames) == 2: self._CurrentStructurePcdName = "" else: - self._ValueList[1] = PcdNames[2] + self._ValueList[1] = TAB_SPLIT.join(PcdNames[2:]) self._ValueList[2] = PcdTockens[1] if not self._CurrentStructurePcdName: TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)