commit: 0768e37e87fd7b73566a4f1b658f941b575bca12
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 15 00:52:39 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 15 00:53:47 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0768e37e
toolchain.eclass: handle RCs correctly
The base GCC-VER file doesn't get updated until the final release.
Signed-off-by: Sam James <sam <AT> gentoo.org>
eclass/toolchain.eclass | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 8788e72efebb..383e533bf8b4 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -461,9 +461,19 @@ toolchain_src_prepare() {
gcc_version_patch
local actual_version=$(< "${S}"/gcc/BASE-VER)
- if [[ "${GCC_RELEASE_VER}" != "${actual_version}" ]] ; then
- eerror "'${S}/gcc/BASE-VER' contains '${actual_version}',
expected '${GCC_RELEASE_VER}'"
- die "Please set 'TOOLCHAIN_GCC_PV' to '${actual_version}'"
+ if [[ ${PV} == *_rc* ]] ; then
+ # Mangle e.g. 11.2.1 -> 11.3.0
+ # Upstream don't update the file until the final release
+ local actual_version_mangled=$(ver_cut 1
${actual_version}).$(($(ver_cut 3 ${actual_version}) + 1)).$(($(ver_cut 5
${actual_version}) + 1))
+ local gcc_release_ver_mangled=$(ver_cut 1
${GCC_RELEASE_VER}).$(($(ver_cut 3 ${GCC_RELEASE_VER}) + 2)).$(($(ver_cut 5
${GCC_RELEASE_VER}) + 1))
+ else
+ local actual_version_mangled=${actual_version}
+ local gcc_release_ver_mangled=${GCC_RELEASE_VER}
+ fi
+
+ if [[ "${actual_version_mangled}" != "${gcc_release_ver_mangled}" ]] ;
then
+ eerror "'${S}/gcc/BASE-VER' contains
'${actual_version_mangled}', expected '${gcc_release_ver_mangled}'"
+ die "Please set 'TOOLCHAIN_GCC_PV' to
'${actual_version_mangled}'"
fi
# >= gcc-4.3 doesn't bundle ecj.jar, so copy it