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/eutils.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/eutils.eclass')
-rw-r--r-- | eclass/eutils.eclass | 21 |
1 files changed, 20 insertions, 1 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] |