From e6d87e5e333e77ffc69cbf14d2c0e8f923a5d6c8 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 19 Oct 2019 11:06:55 +0100 Subject: [PATCH] toolchain.eclass: move gentoo patches into own helper Cleanup. No functional change. Signed-off-by: Sergei Trofimovich --- eclass/toolchain.eclass | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index bc7d7b1c2609..d2de666120eb 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -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 -- 2.26.2