From 7e3711d9fdbcc6f478217a59cc26f9cd6cb05002 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Tue, 11 Oct 2022 11:52:40 +0100 Subject: [PATCH 1/2] Handle 32bit server build. --- installation_and_upgrade/IBEX_upgrade.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/installation_and_upgrade/IBEX_upgrade.py b/installation_and_upgrade/IBEX_upgrade.py index fa5a9075..53f3ae2c 100644 --- a/installation_and_upgrade/IBEX_upgrade.py +++ b/installation_and_upgrade/IBEX_upgrade.py @@ -71,6 +71,7 @@ def _get_latest_existing_dir_path(release_dir, component): parser.add_argument("--quiet", default=False, action="store_true", help="Do not ask any questions just to the default.") parser.add_argument("--kits_icp_dir", default=None, help="Directory of kits/ICP") + parser.add_argument("--server_arch", default="x64", choices=["x64", "x86"], help="Server build architecture.") deployment_types = [f"{choice}: {deployment_types}" for choice, (_, deployment_types) in UPGRADE_TYPES.items()] @@ -85,7 +86,9 @@ def _get_latest_existing_dir_path(release_dir, component): current_client_version = _get_latest_release_path(args.release_dir).split("\\")[-1] if args.release_suffix != "": current_release_dir += f"-{args.release_suffix}" - DIRECTORIES["EPICS"] = os.path.join(current_release_dir, "EPICS") + + server_32bit_suffix = "32" if args.server_arch == "x86" else "" + DIRECTORIES["EPICS"] = os.path.join(current_release_dir, "EPICS" + server_32bit_suffix) DIRECTORIES["Client"] = os.path.join(current_release_dir, "Client") DIRECTORIES["genie_python_3"] = os.path.join(current_release_dir, "genie_python_3") @@ -93,8 +96,12 @@ def _get_latest_existing_dir_path(release_dir, component): for key in DIRECTORIES: if not os.path.isdir(DIRECTORIES[key]): partial_release = True - print(f"Warning: {key} is missing from release.") - DIRECTORIES[key] = _get_latest_existing_dir_path(args.release_dir, key) + if key == "EPICS": + print(f"Warning: {key + server_32bit_suffix} is missing from release.") + DIRECTORIES[key] = _get_latest_existing_dir_path(args.release_dir, key + server_32bit_suffix) + else: + print(f"Warning: {key} is missing from release.") + DIRECTORIES[key] = _get_latest_existing_dir_path(args.release_dir, key) if partial_release: try: From b9d2f6626c4a42781b1b0b93b6ae471ea96914aa Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Mon, 24 Oct 2022 11:05:10 +0100 Subject: [PATCH 2/2] Changed variable name to be more adequate. --- installation_and_upgrade/IBEX_upgrade.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/installation_and_upgrade/IBEX_upgrade.py b/installation_and_upgrade/IBEX_upgrade.py index 53f3ae2c..221aa604 100644 --- a/installation_and_upgrade/IBEX_upgrade.py +++ b/installation_and_upgrade/IBEX_upgrade.py @@ -87,8 +87,8 @@ def _get_latest_existing_dir_path(release_dir, component): if args.release_suffix != "": current_release_dir += f"-{args.release_suffix}" - server_32bit_suffix = "32" if args.server_arch == "x86" else "" - DIRECTORIES["EPICS"] = os.path.join(current_release_dir, "EPICS" + server_32bit_suffix) + server_suffix = "32" if args.server_arch == "x86" else "" + DIRECTORIES["EPICS"] = os.path.join(current_release_dir, "EPICS" + server_suffix) DIRECTORIES["Client"] = os.path.join(current_release_dir, "Client") DIRECTORIES["genie_python_3"] = os.path.join(current_release_dir, "genie_python_3") @@ -97,8 +97,8 @@ def _get_latest_existing_dir_path(release_dir, component): if not os.path.isdir(DIRECTORIES[key]): partial_release = True if key == "EPICS": - print(f"Warning: {key + server_32bit_suffix} is missing from release.") - DIRECTORIES[key] = _get_latest_existing_dir_path(args.release_dir, key + server_32bit_suffix) + print(f"Warning: {key + server_suffix} is missing from release.") + DIRECTORIES[key] = _get_latest_existing_dir_path(args.release_dir, key + server_suffix) else: print(f"Warning: {key} is missing from release.") DIRECTORIES[key] = _get_latest_existing_dir_path(args.release_dir, key)