@@ -38,14 +38,13 @@ def UpdateMetaData(TemplateRoot, PartitionRoot):
3838 DefaultStorageType = ChipId .get ('storage_type' )
3939
4040 PhyPartition = PartitionRoot .findall ('physical_partition' )
41- PartitionsSet = set ()
42- Partitions = PartitionRoot .findall ('physical_partition/partition' )
43- for partition in Partitions :
41+ Partitions = []
42+ for partition in PartitionRoot .findall ('physical_partition/partition' ):
4443 label = partition .get ('label' )
4544 filename = partition .get ('filename' )
4645 if label and filename :
47- PartitionsSet . add (( label , filename ) )
48- print (f"PartitionsSet : { PartitionsSet } " )
46+ Partitions . append ({ ' label' : label , ' filename' : filename } )
47+ print (f"Partitions : { Partitions } " )
4948
5049 def _add_file_elements (parent_element , pathname , file_path_flavor = None ):
5150 """Helper function to add file_name and file_path sub-elements."""
@@ -71,10 +70,10 @@ def _add_file_elements(parent_element, pathname, file_path_flavor=None):
7170 if DownloadFile is not None :
7271 build .remove (DownloadFile )
7372 # Partition entires
74- for Partition in PartitionsSet :
73+ for Partition in Partitions :
7574 new_download_file = ET .SubElement (build , "download_file" )
76- new_download_file .set ("fastboot_complete" , Partition [0 ])
77- _add_file_elements (new_download_file , Partition [1 ])
75+ new_download_file .set ("fastboot_complete" , Partition ['label' ])
76+ _add_file_elements (new_download_file , Partition ['filename' ])
7877 # GPT Main & GPT Backup entries
7978 for PhysicalPartitionNumber in range (0 , len (PhyPartition )):
8079 new_download_file = ET .SubElement (build , "download_file" )
0 commit comments