diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-08-26 21:47:56 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-08-26 21:47:56 +0000 |
commit | 879f8d7efcb9e309f373695d247906452d996f88 (patch) | |
tree | a9e0730c54a25e2e59b94a03ab09fdc78dc37a80 /eclass | |
parent | Version bump #282449 by Jeroen Roovers. (diff) | |
download | historical-879f8d7efcb9e309f373695d247906452d996f88.tar.gz historical-879f8d7efcb9e309f373695d247906452d996f88.tar.bz2 historical-879f8d7efcb9e309f373695d247906452d996f88.zip |
unify duplicated user epatching code
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/eutils.eclass | 21 | ||||
-rw-r--r-- | eclass/toolchain-binutils.eclass | 16 | ||||
-rw-r--r-- | eclass/toolchain.eclass | 20 |
3 files changed, 24 insertions, 33 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 6cde3e6c469b..5b11d69c0b5a 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.317 2009/03/01 08:06:00 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.318 2009/08/26 21:47:56 vapier Exp $ # @ECLASS: eutils.eclass # @MAINTAINER: @@ -349,6 +349,25 @@ epatch() { einfo "Done with patching" fi } +epatch_user() { + [[ $# -ne 0 ]] && die "epatch_user takes no options" + + # don't clobber any EPATCH vars that the parent might want + local EPATCH_SOURCE check base=${PORTAGE_CONFIGROOT}/etc/portage/patches + for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do + EPATCH_SOURCE=${base}/${CTARGET}/${check} + [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${CHOST}/${check} + [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check} + if [[ -d ${EPATCH_SOURCE} ]] ; then + EPATCH_SOURCE=${EPATCH_SOURCE} \ + EPATCH_SUFFIX="patch" \ + EPATCH_FORCE="yes" \ + EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ + epatch + break + fi + done +} # @FUNCTION: emktemp # @USAGE: [temp dir] diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass index 834315f9c214..cc7b9c4f08ec 100644 --- a/eclass/toolchain-binutils.eclass +++ b/eclass/toolchain-binutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.83 2009/05/23 23:07:28 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.84 2009/08/26 21:47:56 vapier Exp $ # # Maintainer: Toolchain Ninjas <toolchain@gentoo.org> # @@ -138,19 +138,7 @@ tc-binutils_apply_patches() { die "sorry, but this binutils doesn't yet support uClibc :(" fi fi - local check base=${PORTAGE_CONFIGROOT}/etc/portage/patches - for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do - EPATCH_SOURCE=${base}/${CTARGET}/${check} - [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${CHOST}/${check} - [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check} - if [[ -d ${EPATCH_SOURCE} ]] ; then - EPATCH_SUFFIX="patch" - EPATCH_FORCE="yes" \ - EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ - epatch - break - fi - done + epatch_user fi # fix locale issues if possible #122216 diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 1e38ea62b2e7..bc2ddb6fb1f5 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.405 2009/08/16 00:16:12 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.406 2009/08/26 21:47:56 vapier Exp $ # # Maintainer: Toolchain Ninjas <toolchain@gentoo.org> @@ -1085,7 +1085,7 @@ gcc_src_unpack() { do_gcc_HTB_patches do_gcc_SSP_patches do_gcc_PIE_patches - do_gcc_USER_patches + epatch_user ${ETYPE}_src_unpack || die "failed to ${ETYPE}_src_unpack" @@ -2103,22 +2103,6 @@ do_gcc_stub() { done } -do_gcc_USER_patches() { - local check base=${PORTAGE_CONFIGROOT}/etc/portage/patches - for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do - EPATCH_SOURCE=${base}/${CTARGET}/${check} - [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${CHOST}/${check} - [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check} - if [[ -d ${EPATCH_SOURCE} ]] ; then - EPATCH_SUFFIX="patch" - EPATCH_FORCE="yes" \ - EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ - epatch - break - fi - done -} - do_gcc_HTB_patches() { if ! want_boundschecking || \ (want_ssp && [[ ${HTB_EXCLUSIVE} == "true" ]]) |