summaryrefslogtreecommitdiff
path: root/bin/update/create_full_mar.py
blob: 39cb23f1f20e765ab788adef2592782724191e29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env python3

import sys
import os
import subprocess
import json
import argparse

from tools import uncompress_file_to_dir, get_file_info, make_complete_mar_name
from config import parse_config
from signing import sign_mar_file
from path import UpdaterPath, convert_to_unix, convert_to_native

current_dir_path = os.path.dirname(os.path.realpath(convert_to_unix(__file__)))


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('product_name')
    parser.add_argument('workdir')
    parser.add_argument('filename_prefix')
    parser.add_argument('update_config')
    args = parser.parse_args()

    update_config = args.update_config
    filename_prefix = args.filename_prefix
    workdir = args.workdir
    product_name = args.update_config

    if len(update_config) == 0:
        print("missing update config")
        sys.exit(1)

    update_path = UpdaterPath(workdir)
    update_path.ensure_dir_exist()

    target_dir = update_path.get_update_dir()
    temp_dir = update_path.get_current_build_dir()

    config = parse_config(update_config)

    tar_dir = os.path.join(update_path.get_workdir(), "installation", product_name, "archive", "install", "en-US")
    tar_file = os.path.join(tar_dir, os.listdir(tar_dir)[0])

    uncompress_dir = uncompress_file_to_dir(tar_file, temp_dir)

    mar_file = make_complete_mar_name(target_dir, filename_prefix)
    path = os.path.join(current_dir_path, 'make_full_update.sh')
    subprocess.call([path, convert_to_native(mar_file), convert_to_native(uncompress_dir)])

    sign_mar_file(target_dir, config, mar_file, filename_prefix)

    file_info = {'complete': get_file_info(mar_file, config.base_url)}

    with open(os.path.join(target_dir, 'complete_info.json'), "w") as complete_info_file:
        json.dump(file_info, complete_info_file, indent=4)


if __name__ == '__main__':
    main()
57d307998e78'>Using .md extension/Markdown syntax for modules READMEHossein 2020-09-25value and targetValue cannot be null at this pointNoel Grandin 2020-07-28Related tdf#135211: return early if no dataJulien Nabet 2020-07-28Typo: Swam->SwarmJulien Nabet 2020-05-06Move all public Java classes to libreoffice.jarSamuel Mehrbrodt 2020-02-04tdf#117331 Merge jurt and unoil into ridlSamuel Mehrbrodt 2019-09-06Fixing '....'Andrea Gelmini 2019-07-27Fix typosAndrea Gelmini 2019-06-03Checking of min and max factor value was added.Todor Balabanov 2019-06-03Range for DE scaling factor was implemented.Todor Balabanov 2019-05-17Some additional manual formatting.Todor Balabanov 2019-05-13nlpsolver: This is considered internal codeSamuel Mehrbrodt 2019-05-12Formatting - Eclipse IDE Java Conventions with spaces for indentation.Todor Balabanov 2019-05-12Generate behavior code simplification and very small speed-up.Todor Balabanov 2019-05-10Import of each class is better practice than import of entire library.Todor Balabanov 2019-05-01Fisher-Yates shuffling algorithm achieves much better randomization.Todor Balabanov 2019-05-01Random class is better than Math random function.Todor Balabanov 2019-05-01Math pow is too slow in this case.Todor Balabanov 2018-06-26tdf#43388: add missing info for Evolutionary Algorithm SolverJulien Nabet 2018-01-27Fix typosAndrea Gelmini 2017-02-03TyposJulien Nabet