aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrik Teivonen <patrik.teivonen@qt.io>2023-03-08 11:58:32 +0200
committerPatrik Teivonen <patrik.teivonen@qt.io>2023-03-09 10:01:58 +0000
commit25573c1551ad8674791646a85bb78ddbb5d9b56a (patch)
tree5b3a3e089c69a31bb6fc64ede5d2fb30d5fac053
parent42aa2cbe22533648c765835dcbf72c7dc026c583 (diff)
create_installer.py: Move LRELEASE_TOOL configuration to argparse
Allow specifying download uri for the lrelease tool binary from CLI. Then we don't need to have this in the environment. Change-Id: Ia95dbc49667b70f590a76ecdd90c66ee530e6d51 Reviewed-by: Antti Kokko <antti.kokko@qt.io>
-rw-r--r--packaging-tools/create_installer.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/packaging-tools/create_installer.py b/packaging-tools/create_installer.py
index ef8b543f3..682369825 100644
--- a/packaging-tools/create_installer.py
+++ b/packaging-tools/create_installer.py
@@ -782,11 +782,11 @@ def create_target_components(task: QtInstallerTaskType) -> None:
log.info("Creating SDK components")
# download and extract lrelease binary for creating translation binaries
- if task.create_repository and os.environ.get("LRELEASE_TOOL"):
+ if task.create_repository and task.lrelease_tool_url:
if not os.path.isfile(os.path.join(task.script_root_dir, "lrelease")):
- download(os.environ.get("LRELEASE_TOOL", ""), task.script_root_dir)
+ download(task.lrelease_tool_url, task.script_root_dir)
extract_file(
- os.path.basename(os.environ.get("LRELEASE_TOOL", "")), task.script_root_dir
+ os.path.basename(task.lrelease_tool_url), task.script_root_dir
)
get_component_data_work = ThreadedWork("get components data")
for sdk_comp in task.sdk_component_list:
@@ -1202,6 +1202,7 @@ class QtInstallerTask(Generic[QtInstallerTaskType]):
version_number_auto_increase_value: str = "-" + strftime("%Y%m%d%H%M", gmtime())
max_cpu_count: int = 8
substitution_list: List[str] = field(default_factory=list)
+ lrelease_tool_url: str = os.getenv("LRELEASE_TOOL", "")
def __post_init__(self) -> None:
log.info("Parsing: %s", self.configuration_file)
@@ -1392,6 +1393,10 @@ def main() -> None:
parser.add_argument("--max-cpu-count", dest="max_cpu_count", type=int, default=8,
help="Set maximum number of CPU's used on packaging")
+ parser.add_argument(
+ "--lrelease-tool", dest="lrelease_tool", type=str, default=os.getenv("LRELEASE_TOOL", ""),
+ help="URL containing lrelease binary for creating translation binaries"
+ )
if is_windows():
parser.add_argument(
"--disable-path-limit-check",
@@ -1427,7 +1432,8 @@ def main() -> None:
remove_debug_information_files=args.remove_debug_information_files,
remove_debug_libraries=args.remove_debug_libraries,
remove_pdb_files=args.remove_pdb_files,
- max_cpu_count=args.max_cpu_count
+ max_cpu_count=args.max_cpu_count,
+ lrelease_tool_url=args.lrelease_tool,
)
create_installer(task)
if task.errors: