mirror of
https://gitee.com/openharmony/update_packaging_tools
synced 2025-02-17 05:18:49 +00:00
fix bug
Signed-off-by: lizhao <lizhao104@huawei.com>
This commit is contained in:
parent
4eb518e7dc
commit
b93e2c402b
@ -292,6 +292,7 @@ def get_progress_value(distributable_value=100):
|
||||
full_img_list = OPTIONS_MANAGER.full_img_list
|
||||
incremental_img_list = OPTIONS_MANAGER.incremental_img_list
|
||||
file_size_list = []
|
||||
each_img_size = 0
|
||||
if len(full_img_list) == 0 and len(incremental_img_list) == 0:
|
||||
UPDATE_LOGGER.print_log(
|
||||
"get progress value failed! > getting progress value failed!",
|
||||
@ -302,7 +303,7 @@ def get_progress_value(distributable_value=100):
|
||||
if partition in OPTIONS_MANAGER.incremental_image_file_obj_dict:
|
||||
file_obj = OPTIONS_MANAGER.incremental_image_file_obj_dict[partition]
|
||||
each_img_size = os.path.getsize(file_obj.name)
|
||||
else:
|
||||
elif partition in OPTIONS_MANAGER.incremental_block_file_obj_dict:
|
||||
new_dat_file_obj, patch_dat_file_obj, transfer_list_file_obj =\
|
||||
OPTIONS_MANAGER.incremental_block_file_obj_dict[partition].get_file_obj()
|
||||
each_img_size = os.path.getsize(new_dat_file_obj.name) + os.path.getsize(patch_dat_file_obj.name)
|
||||
|
@ -113,7 +113,7 @@ class TestScriptGenerator(unittest.TestCase):
|
||||
file_obj = wo_f
|
||||
OPTIONS_MANAGER.full_img_list = []
|
||||
OPTIONS_MANAGER.incremental_img_list = ['vendor', 'updater']
|
||||
OPTIONS_MANAGER.incremental_image_file_obj_list = [file_obj]
|
||||
OPTIONS_MANAGER.incremental_image_file_obj_dict['vendor'] = file_obj
|
||||
progress_value_dict = get_progress_value(distributable_value=60)
|
||||
check_re = len(progress_value_dict) != 0
|
||||
self.assertEqual(check_re, True)
|
||||
|
@ -457,6 +457,7 @@ def build_update_package(no_zip, update_package, prelude_script,
|
||||
|
||||
for partition, patch_obj in OPTIONS_MANAGER.incremental_image_file_obj_dict.items():
|
||||
zip_file.write(patch_obj.name, "%s.patch.dat" % partition)
|
||||
zip_file.close()
|
||||
|
||||
signed_package = os.path.join(
|
||||
update_package, "%s.zip" % update_file_name)
|
||||
|
3
utils.py
3
utils.py
@ -311,7 +311,6 @@ def parse_update_config(xml_path):
|
||||
for component in component_info:
|
||||
component_list = list(component.values())
|
||||
component_list.pop()
|
||||
component_dict[component['@compAddr']] = component_list
|
||||
|
||||
if component['@compAddr'] in (whole_list + difference_list):
|
||||
UPDATE_LOGGER.print_log("This component %s repeats!" %
|
||||
@ -327,6 +326,7 @@ def parse_update_config(xml_path):
|
||||
tem_path = os.path.join(OPTIONS_MANAGER.target_package_dir,
|
||||
component.get("#text", None))
|
||||
full_image_path_list.append(tem_path)
|
||||
component_dict[component['@compAddr']] = component_list
|
||||
elif component['@compType'] == '1':
|
||||
difference_list.append(component['@compAddr'])
|
||||
OPTIONS_MANAGER.incremental_img_name_list.\
|
||||
@ -470,7 +470,6 @@ def clear_options():
|
||||
|
||||
# Incremental processing parameters
|
||||
OPTIONS_MANAGER.incremental_content_len_list = []
|
||||
OPTIONS_MANAGER.incremental_image_file_obj_list = []
|
||||
OPTIONS_MANAGER.incremental_temp_file_obj_list = []
|
||||
|
||||
# Script parameters
|
||||
|
Loading…
x
Reference in New Issue
Block a user