summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-06-28 14:44:08 +0000
committerMike Frysinger <vapier@gentoo.org>2007-06-28 14:44:08 +0000
commitd9f2084754bbf130d71df7c40cbdb020083f941f (patch)
tree9e4ba166c9d5865e803ceb2b7ca86aa51e182ccd /eclass
parentAdded LCD masks for bug #180683. (diff)
downloadgentoo-2-d9f2084754bbf130d71df7c40cbdb020083f941f.tar.gz
gentoo-2-d9f2084754bbf130d71df7c40cbdb020083f941f.tar.bz2
gentoo-2-d9f2084754bbf130d71df7c40cbdb020083f941f.zip
refactor patch code a bit
Diffstat (limited to 'eclass')
-rw-r--r--eclass/toolchain-binutils.eclass55
1 files changed, 35 insertions, 20 deletions
diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass
index ea97176bcfd2..cecf0d5abf9e 100644
--- a/eclass/toolchain-binutils.eclass
+++ b/eclass/toolchain-binutils.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/toolchain-binutils.eclass,v 1.74 2007/06/28 12:55:51 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.75 2007/06/28 14:44:08 vapier Exp $
#
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
#
@@ -111,26 +111,41 @@ tc-binutils_unpack() {
tc-binutils_apply_patches() {
cd "${S}"
- if ! use vanilla && [[ -n ${PATCHVER} ]] ; then
- EPATCH_SOURCE=${WORKDIR}/patch
- [[ -n $(ls "${EPATCH_SOURCE}"/*.bz2 2>/dev/null) ]] \
- && EPATCH_SUFFIX="patch.bz2" \
- || EPATCH_SUFFIX="patch"
- epatch
- fi
- if ! use vanilla && [[ -n ${UCLIBC_PATCHVER} ]] ; then
- EPATCH_SOURCE=${WORKDIR}/uclibc-patches
- [[ -n $(ls "${EPATCH_SOURCE}"/*.bz2 2>/dev/null) ]] \
- && EPATCH_SUFFIX="patch.bz2" \
- || EPATCH_SUFFIX="patch"
- EPATCH_MULTI_MSG="Applying uClibc fixes ..." \
- epatch
- elif [[ ${CTARGET} == *-uclibc* ]] ; then
- # starting with binutils-2.17.50.0.17, we no longer need
- # uClibc patchsets :D
- if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
- die "sorry, but this binutils doesn't yet support uClibc :("
+ if ! use vanilla ; then
+ if [[ -n ${PATCHVER} ]] ; then
+ EPATCH_SOURCE=${WORKDIR}/patch
+ [[ -n $(ls "${EPATCH_SOURCE}"/*.bz2 2>/dev/null) ]] \
+ && EPATCH_SUFFIX="patch.bz2" \
+ || EPATCH_SUFFIX="patch"
+ epatch
+ fi
+ if [[ -n ${UCLIBC_PATCHVER} ]] ; then
+ EPATCH_SOURCE=${WORKDIR}/uclibc-patches
+ [[ -n $(ls "${EPATCH_SOURCE}"/*.bz2 2>/dev/null) ]] \
+ && EPATCH_SUFFIX="patch.bz2" \
+ || EPATCH_SUFFIX="patch"
+ EPATCH_MULTI_MSG="Applying uClibc fixes ..." \
+ epatch
+ elif [[ ${CTARGET} == *-uclibc* ]] ; then
+ # starting with binutils-2.17.50.0.17, we no longer need
+ # uClibc patchsets :D
+ if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
+ 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
fi
# fix locale issues if possible #122216