diff options
author | Sam James <sam@gentoo.org> | 2022-04-15 01:52:39 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-04-15 01:53:47 +0100 |
commit | 0768e37e87fd7b73566a4f1b658f941b575bca12 (patch) | |
tree | 2344b362e495ec2ea52347eebc551d426f5c9484 /eclass/toolchain.eclass | |
parent | dev-libs/libgcrypt: rename o-flag-munging -> custom-cflags (diff) | |
download | gentoo-0768e37e87fd7b73566a4f1b658f941b575bca12.tar.gz gentoo-0768e37e87fd7b73566a4f1b658f941b575bca12.tar.bz2 gentoo-0768e37e87fd7b73566a4f1b658f941b575bca12.zip |
toolchain.eclass: handle RCs correctly
The base GCC-VER file doesn't get updated until the final release.
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r-- | eclass/toolchain.eclass | 16 |
1 files 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 |