Loading tools/releasetools/merge/merge_target_files.py +9 −3 Original line number Original line Diff line number Diff line Loading @@ -149,6 +149,13 @@ OPTIONS.framework_dexpreopt_tools = None OPTIONS.vendor_dexpreopt_config = None OPTIONS.vendor_dexpreopt_config = None def move_only_exists(source, destination): """Judge whether the file exists and then move the file.""" if os.path.exists(source): shutil.move(source, destination) def create_merged_package(temp_dir): def create_merged_package(temp_dir): """Merges two target files packages into one target files structure. """Merges two target files packages into one target files structure. Loading Loading @@ -286,8 +293,7 @@ def rebuild_image_with_sepolicy(target_files_dir): shutil.move( shutil.move( os.path.join(vendor_target_files_dir, 'IMAGES', partition_img), os.path.join(vendor_target_files_dir, 'IMAGES', partition_img), os.path.join(target_files_dir, 'IMAGES', partition_img)) os.path.join(target_files_dir, 'IMAGES', partition_img)) shutil.move( move_only_exists(os.path.join(vendor_target_files_dir, 'IMAGES', partition_map), os.path.join(vendor_target_files_dir, 'IMAGES', partition_map), os.path.join(target_files_dir, 'IMAGES', partition_map)) os.path.join(target_files_dir, 'IMAGES', partition_map)) def copy_recovery_file(filename): def copy_recovery_file(filename): Loading Loading
tools/releasetools/merge/merge_target_files.py +9 −3 Original line number Original line Diff line number Diff line Loading @@ -149,6 +149,13 @@ OPTIONS.framework_dexpreopt_tools = None OPTIONS.vendor_dexpreopt_config = None OPTIONS.vendor_dexpreopt_config = None def move_only_exists(source, destination): """Judge whether the file exists and then move the file.""" if os.path.exists(source): shutil.move(source, destination) def create_merged_package(temp_dir): def create_merged_package(temp_dir): """Merges two target files packages into one target files structure. """Merges two target files packages into one target files structure. Loading Loading @@ -286,8 +293,7 @@ def rebuild_image_with_sepolicy(target_files_dir): shutil.move( shutil.move( os.path.join(vendor_target_files_dir, 'IMAGES', partition_img), os.path.join(vendor_target_files_dir, 'IMAGES', partition_img), os.path.join(target_files_dir, 'IMAGES', partition_img)) os.path.join(target_files_dir, 'IMAGES', partition_img)) shutil.move( move_only_exists(os.path.join(vendor_target_files_dir, 'IMAGES', partition_map), os.path.join(vendor_target_files_dir, 'IMAGES', partition_map), os.path.join(target_files_dir, 'IMAGES', partition_map)) os.path.join(target_files_dir, 'IMAGES', partition_map)) def copy_recovery_file(filename): def copy_recovery_file(filename): Loading