]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Support nest field name in DSC/DEC
authorLiming Gao <liming.gao@intel.com>
Tue, 19 Dec 2017 08:01:38 +0000 (16:01 +0800)
committerLiming Gao <liming.gao@intel.com>
Mon, 25 Dec 2017 03:05:53 +0000 (11:05 +0800)
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/Workspace/DscBuildData.py
BaseTools/Source/Python/Workspace/MetaFileParser.py

index 23c2c0d4102e92a421cbe5fc0397641f4a555d75..4642e761b9150c4055b9a5b64b0965cbaa53a53a 100644 (file)
@@ -1207,18 +1207,19 @@ class DscBuildData(PlatformBuildClassObject):
 \r
         def get_length(value):\r
             Value = value.strip()\r
-            if Value.startswith('GUID') and Value.endswith(')'):\r
-                return 16\r
-            if Value.startswith('L"') and Value.endswith('"'):\r
-                return len(Value[2:-1])\r
-            if Value[0] == '"' and Value[-1] == '"':\r
-                return len(Value) - 2\r
-            if Value[0] == '{' and Value[-1] == '}':\r
-                return len(Value.split(","))\r
-            if Value.startswith("L'") and Value.endswith("'") and len(list(Value[2:-1])) > 1:\r
-                return  len(list(Value[2:-1]))\r
-            if Value[0] == "'" and Value[-1] == "'" and len(list(Value[1:-1])) > 1:\r
-                return len(Value) - 2\r
+            if len(value) > 1:\r
+                if Value.startswith('GUID') and Value.endswith(')'):\r
+                    return 16\r
+                if Value.startswith('L"') and Value.endswith('"'):\r
+                    return len(Value[2:-1])\r
+                if Value[0] == '"' and Value[-1] == '"':\r
+                    return len(Value) - 2\r
+                if Value[0] == '{' and Value[-1] == '}':\r
+                    return len(Value.split(","))\r
+                if Value.startswith("L'") and Value.endswith("'") and len(list(Value[2:-1])) > 1:\r
+                    return  len(list(Value[2:-1]))\r
+                if Value[0] == "'" and Value[-1] == "'" and len(list(Value[1:-1])) > 1:\r
+                    return len(Value) - 2\r
             return len(Value)\r
 \r
         return str(max([pcd_size for pcd_size in [get_length(item) for item in sku_values]]))\r
index 6fa008ef65529de52b14de795699b62fd7743322..303844785043405bc4489806eef628a926a370e8 100644 (file)
@@ -1136,6 +1136,8 @@ class DscParser(MetaFileParser):
             self._ValueList[0], self._ValueList[1] = PcdNameTockens[0], PcdNameTockens[1]\r
         elif len(PcdNameTockens) == 3:\r
             self._ValueList[0], self._ValueList[1] = ".".join((PcdNameTockens[0], PcdNameTockens[1])), PcdNameTockens[2]\r
+        elif len(PcdNameTockens) > 3:\r
+            self._ValueList[0], self._ValueList[1] = ".".join((PcdNameTockens[0], PcdNameTockens[1])), ".".join(PcdNameTockens[2:])\r
         if len(TokenList) == 2:\r
             self._ValueList[2] = TokenList[1]\r
         if self._ValueList[0] == '' or self._ValueList[1] == '':\r
@@ -1910,7 +1912,7 @@ class DecParser(MetaFileParser):
                 if len(PcdNames) == 2:\r
                     self._CurrentStructurePcdName = ""\r
                 else:\r
-                    self._ValueList[1] = PcdNames[2]\r
+                    self._ValueList[1] = TAB_SPLIT.join(PcdNames[2:])\r
                     self._ValueList[2] = PcdTockens[1]\r
         if not self._CurrentStructurePcdName:\r
             TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)\r