diff options
author | Patrik Teivonen <patrik.teivonen@qt.io> | 2022-04-05 14:42:56 +0300 |
---|---|---|
committer | Patrik Teivonen <patrik.teivonen@qt.io> | 2022-04-11 09:28:12 +0000 |
commit | bc389936cfb72e51da63291abf94482c3da98761 (patch) | |
tree | 818857a8364d450da0a847abecb802fb20ff7b08 | |
parent | 1bed01376393f7f5fb8780ec82b91b886229a79b (diff) |
release_repo_updater.py: use Python 3 when invoking create_installer.py
Find platform specific path for Python 3 and use it instead of Python 2
create_installer.py has been ported to Python 3 in previous commits
Change-Id: I790dafef425a9ebe2f1f78d5692365af8c7f30e2
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
-rwxr-xr-x | packaging-tools/qt6_installer/release_repo_updater.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/packaging-tools/qt6_installer/release_repo_updater.py b/packaging-tools/qt6_installer/release_repo_updater.py index 1a36d58ca..45555d6a7 100755 --- a/packaging-tools/qt6_installer/release_repo_updater.py +++ b/packaging-tools/qt6_installer/release_repo_updater.py @@ -3,7 +3,7 @@ ############################################################################# ## -## Copyright (C) 2021 The Qt Company Ltd. +## Copyright (C) 2022 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the release tools of the Qt Toolkit. @@ -419,6 +419,14 @@ async def update_repository(stagingServer: str, repoLayout: QtRepositoryLayout, trigger_rta(rta, task) +def get_python_path(): + # temporary function will be removed later during refactoring + import platform + if platform.system() == "Windows": + return os.path.join(os.getenv("PYTHON3_PATH"), "python.exe") + return "python3" + + async def build_online_repositories(tasks: List[ReleaseTask], license: str, installerConfigBaseDir: str, artifactShareBaseUrl: str, ifwTools: str, buildRepositories: bool) -> List[str]: log.info("Building online repositories: %i", len(tasks)) @@ -450,7 +458,7 @@ async def build_online_repositories(tasks: List[ReleaseTask], license: str, inst raise PackagingError("Invalid 'config_file' path: {0}".format(installerConfigFile)) # TODO: license - cmd = ["python", scriptPath, "-c", installerConfigBaseDir, "-f", installerConfigFile] + cmd = [get_python_path(), scriptPath, "-c", installerConfigBaseDir, "-f", installerConfigFile] cmd += ["--create-repo", "-l", license, "--license-type", license, "-u", artifactShareBaseUrl, "--ifw-tools", ifwTools] cmd += ["--force-version-number-increase"] for substitution in task.get_installer_string_replacement_list(): @@ -668,10 +676,7 @@ async def _build_offline_tasks(stagingServer: str, stagingServerRoot: str, tasks if not os.path.isfile(installerConfigFile): raise PackagingError(f"Invalid 'config_file' path: {installerConfigFile}") - python_cmd = "python" - if os.environ.get('PYTHON2_32_PATH'): - python_cmd = os.path.join(os.environ.get('PYTHON2_32_PATH'), "python.exe") - cmd = [python_cmd, scriptPath, "-c", installerConfigBaseDir, "-f", installerConfigFile] + cmd = [get_python_path(), scriptPath, "-c", installerConfigBaseDir, "-f", installerConfigFile] cmd += ["--offline", "-l", license, "--license-type", license, "-u", artifactShareBaseUrl, "--ifw-tools", ifwTools] cmd += ["--preferred-installer-name", task.get_installer_name()] cmd.extend(["--add-substitution=" + s for s in task.get_installer_string_replacement_list()]) |