From 849a1b1a89445e4d8c46e042e9308a5be62c7e56 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Tue, 23 Nov 2021 09:16:47 +0000 Subject: [PATCH] Fix an RPM build issue that could lead to a conflict with python3 at installation. Fixes #7013. --- docs/en_US/release_notes_6_3.rst | 1 + pkg/linux/build-functions.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_6_3.rst b/docs/en_US/release_notes_6_3.rst index 4c7396961..166ab1fe2 100644 --- a/docs/en_US/release_notes_6_3.rst +++ b/docs/en_US/release_notes_6_3.rst @@ -23,3 +23,4 @@ Bug fixes | `Issue #6986 `_ - Fixed an issue where the user can't debug function with timestamp parameter. | `Issue #6989 `_ - Fixed an issue where the Change Password menu option is missing for internal authentication source when more than one authentication source is defined. | `Issue #7006 `_ - Ensure that Python 3.10 and the latest eventlet dependency should not break the application. +| `Issue #7013 `_ - Fix an RPM build issue that could lead to a conflict with python3 at installation. \ No newline at end of file diff --git a/pkg/linux/build-functions.sh b/pkg/linux/build-functions.sh index 7ad496789..f6364f760 100644 --- a/pkg/linux/build-functions.sh +++ b/pkg/linux/build-functions.sh @@ -215,12 +215,14 @@ _copy_code() { mkdir -p "${WEBROOT}/usr/${APP_NAME}/bin/" cp "${SOURCEDIR}/pkg/linux/setup-web.sh" "${WEBROOT}/usr/${APP_NAME}/bin/" - # Ensure our venv will use the correct Python interpretor, even if the + # Ensure our venv will use the correct Python interpreter, even if the # user has configured an alternative default. # DO THIS LAST! cd "${SERVERROOT}/usr/${APP_NAME}/venv/bin" PYTHON_INTERPRETER=$(/usr/bin/python3 -c "import os, sys; print(os.path.realpath(sys.executable))") + PYTHON_VERSION=$(/usr/bin/python3 -c "import sys; print('%d.%d' % (sys.version_info.major, sys.version_info.minor))") rm python && ln -s python3 python + rm python${PYTHON_VERSION} && ln -s python3 python${PYTHON_VERSION} rm python3 && ln -s "${PYTHON_INTERPRETER}" python3 }