diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-04 07:23:26 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-04 07:46:40 +0200 |
commit | e74846af5130daa9c96babea6987befeb8a8e75c (patch) | |
tree | 09868f6fad54646ce43f370c529b55f8a3a0306a | |
parent | e4420db1a80fc53e23eafcd6b1dfe1aca293d60f (diff) |
updater: get the partial update generation working on windows
Change-Id: I01d8958801e7c5b2d08dd79b0469dfab1f6dee72
Reviewed-on: https://gerrit.libreoffice.org/40757
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rwxr-xr-x | bin/update/create_partial_update.py | 31 | ||||
-rwxr-xr-x | bin/update/uncompress_mar.py | 7 |
2 files changed, 21 insertions, 17 deletions
diff --git a/bin/update/create_partial_update.py b/bin/update/create_partial_update.py index aa5a119166db..e4005d5173a9 100755 --- a/bin/update/create_partial_update.py +++ b/bin/update/create_partial_update.py @@ -13,10 +13,10 @@ from uncompress_mar import extract_mar from tools import get_file_info, get_hash from signing import sign_mar_file -from path import UpdaterPath, mkdir_p +from path import UpdaterPath, mkdir_p, convert_to_unix, convert_to_native BUF_SIZE = 1024 -current_dir_path = os.path.dirname(os.path.realpath(__file__)) +current_dir_path = os.path.dirname(os.path.realpath(convert_to_unix(__file__))) def InvalidFileException(Exception): @@ -126,24 +126,27 @@ def main(): for build, update in updates.items(): file_name = generate_file_name(build_id, build, mar_name_prefix) mar_file = os.path.join(update_dir, file_name) - subprocess.call([os.path.join(current_dir_path, 'make_incremental_update.sh'), mar_file, update["complete"], current_build_path]) + subprocess.call([os.path.join(current_dir_path, 'make_incremental_update.sh'), convert_to_native(mar_file), convert_to_native(update["complete"]), convert_to_native(current_build_path)]) sign_mar_file(update_dir, config, mar_file, mar_name_prefix) partial_info = {"file":get_file_info(mar_file, config.base_url), "from": build, "to": build_id, "languages": {}} - for lang, lang_info in update["languages"].items(): - lang_name = generate_lang_file_name(build_id, build, mar_name_prefix, lang) - # write the file into the final directory - lang_mar_file = os.path.join(update_dir, lang_name) + # on Windows we don't use language packs + if sys.platform != "cygwin": + for lang, lang_info in update["languages"].items(): + lang_name = generate_lang_file_name(build_id, build, mar_name_prefix, lang) - # the directory of the old language file is of the form - # workdir/mar/language/en-US/LibreOffice_<version>_<os>_archive_langpack_<lang>/ - language_dir = add_single_dir(os.path.join(mar_dir, "language", lang)) - subprocess.call([os.path.join(current_dir_path, 'make_incremental_update.sh'), lang_mar_file, lang_info, language_dir]) - sign_mar_file(update_dir, config, lang_mar_file, mar_name_prefix) + # write the file into the final directory + lang_mar_file = os.path.join(update_dir, lang_name) - # add the partial language info - partial_info["languages"][lang] = get_file_info(lang_mar_file, config.base_url) + # the directory of the old language file is of the form + # workdir/mar/language/en-US/LibreOffice_<version>_<os>_archive_langpack_<lang>/ + language_dir = add_single_dir(os.path.join(mar_dir, "language", lang)) + subprocess.call([os.path.join(current_dir_path, 'make_incremental_update.sh'), convert_to_native(lang_mar_file), convert_to_native(lang_info), convert_to_native(language_dir)]) + sign_mar_file(update_dir, config, lang_mar_file, mar_name_prefix) + + # add the partial language info + partial_info["languages"][lang] = get_file_info(lang_mar_file, config.base_url) data["partials"].append(partial_info) diff --git a/bin/update/uncompress_mar.py b/bin/update/uncompress_mar.py index 4c5f40733d41..cecb16af0e6c 100755 --- a/bin/update/uncompress_mar.py +++ b/bin/update/uncompress_mar.py @@ -13,17 +13,18 @@ import os import sys import subprocess +from path import convert_to_native def uncompress_content(file_path): bzip2 = os.environ.get('BZIP2', 'bzip2') file_path_compressed = file_path + ".bz2" os.rename(file_path, file_path_compressed) - subprocess.check_call(["bzip2", "-d", file_path_compressed]) + subprocess.check_call(["bzip2", "-d", convert_to_native(file_path_compressed)]) def extract_mar(mar_file, target_dir): mar = os.environ.get('MAR', 'mar') - subprocess.check_call([mar, "-C", target_dir, "-x", mar_file]) - file_info = subprocess.check_output([mar, "-t", mar_file]) + subprocess.check_call([mar, "-C", convert_to_native(target_dir), "-x", convert_to_native(mar_file)]) + file_info = subprocess.check_output([mar, "-t", convert_to_native(mar_file)]) lines = file_info.splitlines() for line in lines: info = line.split() |