Commit b1f0fe8a authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_package: Update createInstallationData function to remove data from conflicted_data list

parent 5b2748f6
...@@ -452,7 +452,7 @@ def createInstallationData(package_list): ...@@ -452,7 +452,7 @@ def createInstallationData(package_list):
for package in package_list: for package in package_list:
path_list.extend(package.getTemplatePathList()) path_list.extend(package.getTemplatePathList())
path_list = list(set(path_list)) path_list = list(set(path_list))
import copy
for package in package_list: for package in package_list:
obj_dict = package._path_item._objects obj_dict = package._path_item._objects
hash_dict = package._path_item._hash hash_dict = package._path_item._hash
...@@ -474,11 +474,14 @@ def createInstallationData(package_list): ...@@ -474,11 +474,14 @@ def createInstallationData(package_list):
# compare hash of the objects # compare hash of the objects
else: else:
# Leave the metadata in final_data in case the hash matches, # Leave the metadata in final_data in case the hash matches,
# else add it to conflicted_data # else add it to conflicted_data and remove the older
if final_data[path]['sha'] == object_metadata['sha']: if final_data[path]['sha'] == object_metadata['sha']:
continue continue
else: else:
conflicted_data[path] = [object_metadata] conflicted_data[path] = [object_metadata]
conflict_object_metadata = copy.copy(final_data[path])
conflicted_data[path].append(conflict_object_metadata)
del final_data[path]
return final_data, conflicted_data return final_data, conflicted_data
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment