From ae4d7a5384649518f650520b0c211ff2c9793f32 Mon Sep 17 00:00:00 2001 From: Iikka Eklund Date: Thu, 5 Jul 2012 13:28:26 +0300 Subject: Critical fix for packaging scripts If one installer component had more than one archive the packaging script resulted invalid archives. This patch fixes the problem. Change-Id: I036c32779846f5bccb247aa7862843dee2d8e450 Reviewed-by: Friedemann Kleint Reviewed-by: Marius Storm-Olsen --- release-tools/create_installer.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/release-tools/create_installer.py b/release-tools/create_installer.py index a4b5068..dd9bd06 100644 --- a/release-tools/create_installer.py +++ b/release-tools/create_installer.py @@ -496,6 +496,14 @@ def repackage_content_for_installation(install_dir, package_raw_name, target_ins # lastly compress the component back to .7z archive archive_component(package_name, archive_name) + # move archive in temporary path + tmp_path = os.path.normpath(PACKAGES_FULL_PATH_DST + os.sep + package_name + os.sep + 'tmp') + bldinstallercommon.create_dirs(tmp_path) + src_file = os.path.normpath(PACKAGES_FULL_PATH_DST + os.sep + package_name + os.sep + 'data' + os.sep + archive_name) + dst_file = os.path.normpath(PACKAGES_FULL_PATH_DST + os.sep + package_name + os.sep + 'tmp' + os.sep + archive_name) + print ' Moving: ' + src_file + print ' Into: ' + dst_file + shutil.move(src_file, dst_file) ############################################################## @@ -594,6 +602,29 @@ def handle_archive(sdk_component, archive): archive.archive_name) +############################################################## +# Finalize package archives +############################################################## +def finalize_package_archives(sdk_component): + """Finalize package archives""" + print ' Finalize package archives for: ' + sdk_component.package_name + # move arhives from tmp under data + src_path = os.path.normpath(PACKAGES_FULL_PATH_DST + os.sep + sdk_component.package_name + os.sep + 'tmp') + if not os.path.exists(src_path): + return + + dst_path = os.path.normpath(PACKAGES_FULL_PATH_DST + os.sep + sdk_component.package_name + os.sep + 'data') + ldir = os.listdir(src_path) + for item in ldir: + src_file = src_path + os.sep + item + dst_file = dst_path + os.sep + item + print ' Moving: ' + src_file + print ' Into: ' + dst_file + shutil.move(src_file, dst_file) + # lastly remove tmp dir + bldinstallercommon.remove_tree(src_path) + + ############################################################## # Parse SDK components ############################################################## @@ -710,6 +741,8 @@ def create_target_components(target_config, offline_mode): # fetch packages only if offline installer, for online installer just handle the metadata if offline_mode: handle_archive(sdk_component, archive) + # finalize archives + finalize_package_archives(sdk_component) # substitute downloadable archive names in installscript.qs downloadableArchives_list = sdk_component.generate_downloadable_archive_list(downloadable_archive_list) substitute_component_tags(downloadableArchives_list, meta_dir_dest) -- cgit v1.2.3