toolchain.eclass: don't override release vesion, assert it instead
authorSergei Trofimovich <slyfox@gentoo.org>
Sun, 26 Jan 2020 19:29:54 +0000 (19:29 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Sun, 26 Jan 2020 20:55:32 +0000 (20:55 +0000)
Closes: https://bugs.gentoo.org/706240
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/toolchain.eclass

index a535707f7eced50880c585714991ee8fa51f1746..97c9e585723e3adb31e38fe09398331db46189eb 100644 (file)
@@ -568,8 +568,10 @@ toolchain_src_prepare() {
        gcc_version_patch
 
        if tc_version_is_at_least 4.1 ; then
-               if [[ -n ${SNAPSHOT} ]] || tc_is_live ; then
-                       echo "${GCC_CONFIG_VER}" > "${S}"/gcc/BASE-VER
+               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 rename ebuild to '${PN}-${actual_version}...'"
                fi
        fi
 
@@ -799,7 +801,7 @@ gcc_version_patch() {
        # gcc-4.3+ has configure flags (whoo!)
        tc_version_is_at_least 4.3 && return 0
 
-       local version_string=${GCC_CONFIG_VER}
+       local version_string=${GCC_RELEASE_VER}
 
        einfo "patching gcc version: ${version_string} (${BRANDING_GCC_PKGVERSION})"