toolchain.eclass: move gentoo patches into own helper
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 19 Oct 2019 10:06:55 +0000 (11:06 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 19 Oct 2019 21:20:22 +0000 (22:20 +0100)
Cleanup. No functional change.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/toolchain.eclass

index bc7d7b1c2609efc21dac763362a73283de6883a6..d2de666120eb68e5d678172b0f7d0630e8a5cf2a 100644 (file)
@@ -522,19 +522,7 @@ toolchain_src_prepare() {
        export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}"
        cd "${S}"
 
-       if ! use vanilla ; then
-               if [[ -n ${PATCH_VER} ]] ; then
-                       guess_patch_type_in_dir "${WORKDIR}"/patch
-                       EPATCH_MULTI_MSG="Applying Gentoo patches ..." \
-                       epatch "${WORKDIR}"/patch
-                       BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION} p${PATCH_VER}"
-               fi
-               if [[ -n ${UCLIBC_VER} ]] ; then
-                       guess_patch_type_in_dir "${WORKDIR}"/uclibc
-                       EPATCH_MULTI_MSG="Applying uClibc patches ..." \
-                       epatch "${WORKDIR}"/uclibc
-               fi
-       fi
+       do_gcc_gentoo_patches
        do_gcc_HTB_patches
        do_gcc_PIE_patches
        do_gcc_CYGWINPORTS_patches
@@ -650,6 +638,22 @@ guess_patch_type_in_dir() {
                || EPATCH_SUFFIX="patch"
 }
 
+do_gcc_gentoo_patches() {
+       if ! use vanilla ; then
+               if [[ -n ${PATCH_VER} ]] ; then
+                       guess_patch_type_in_dir "${WORKDIR}"/patch
+                       EPATCH_MULTI_MSG="Applying Gentoo patches ..." \
+                       epatch "${WORKDIR}"/patch
+                       BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION} p${PATCH_VER}"
+               fi
+               if [[ -n ${UCLIBC_VER} ]] ; then
+                       guess_patch_type_in_dir "${WORKDIR}"/uclibc
+                       EPATCH_MULTI_MSG="Applying uClibc patches ..." \
+                       epatch "${WORKDIR}"/uclibc
+               fi
+       fi
+}
+
 do_gcc_HTB_patches() {
        use_if_iuse boundschecking || return 0