[Libreoffice-commits] core.git: bin/update

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Aug 4 05:47:14 UTC 2017


 bin/update/create_partial_update.py |   31 +++++++++++++++++--------------
 bin/update/uncompress_mar.py        |    7 ++++---
 2 files changed, 21 insertions(+), 17 deletions(-)

New commits:
commit e74846af5130daa9c96babea6987befeb8a8e75c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Aug 4 07:23:26 2017 +0200

    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 at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

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()


More information about the Libreoffice-commits mailing list