]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools ConvertFceToStructurePcd: Fix the array value with empty string
authorLiming Gao <liming.gao@intel.com>
Tue, 30 Oct 2018 14:59:45 +0000 (22:59 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 31 Oct 2018 14:07:57 +0000 (22:07 +0800)
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Scripts/ConvertFceToStructurePcd.py

index 6ca51c4ed1a790e9f5074fc13ece512752cbb052..9240b8f0f3ea4ebb613a7ac7d8373e4b3cc1fe38 100644 (file)
@@ -303,7 +303,10 @@ class Config(object):
     list1 = [t for t in list1 if t != '']  # remove '' form list\r
     first_num = int(list1[0], 16)\r
     if list1[first_num + 1] == 'STRING':  # parser STRING\r
-      value = 'L%s' % list1[-1]\r
+      if list1[-1] == '""':\r
+        value = "{0x0, 0x0}"\r
+      else:\r
+        value = 'L%s' % list1[-1]\r
     elif list1[first_num + 1] == 'ORDERED_LIST':  # parser ORDERED_LIST\r
       value_total = int(list1[first_num + 2])\r
       list2 = list1[-value_total:]\r
@@ -505,12 +508,22 @@ class mainprocess(object):
     inf_list = self.del_repeat(inf_list)\r
     header_list = self.plus(self.del_repeat(header_list))\r
     title_all=list(set(title_list))\r
-    info_list = self.del_repeat(info_list)\r
+    info_list = self.remove_bracket(self.del_repeat(info_list))\r
     for i in range(len(info_list)-1,-1,-1):\r
       if len(info_list[i]) == 0:\r
         info_list.remove(info_list[i])\r
     return keys,title_all,info_list,header_list,inf_list\r
 \r
+  def remove_bracket(self,List):\r
+    for i in List:\r
+      for j in i:\r
+        tmp = j.split("|")\r
+        if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0, 0x0}'):\r
+          tmp[0] = tmp[0][:tmp[0].index('[')]\r
+          List[List.index(i)][i.index(j)] = "|".join(tmp)\r
+        else:\r
+          List[List.index(i)][i.index(j)] = j\r
+    return List\r
 \r
   def write_all(self):\r
     title_flag=1\r