diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-03-12 04:29:09 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-03-12 04:29:09 +0000 |
commit | 33a7a7cc1c27a27e57631864223b799df66d62b2 (patch) | |
tree | aa2a693398cc6d50457f678ce168cbc4c02d7456 /eclass | |
parent | Grab fix from Fedora for accessing tls vars (like errno). (diff) | |
download | gentoo-2-33a7a7cc1c27a27e57631864223b799df66d62b2.tar.gz gentoo-2-33a7a7cc1c27a27e57631864223b799df66d62b2.tar.bz2 gentoo-2-33a7a7cc1c27a27e57631864223b799df66d62b2.zip |
add a func to automatically process patches in rpm specs
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/rpm.eclass | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/eclass/rpm.eclass b/eclass/rpm.eclass index fa81c15b4d2d..cd8d11f41e35 100644 --- a/eclass/rpm.eclass +++ b/eclass/rpm.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/rpm.eclass,v 1.15 2006/06/27 06:49:09 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/rpm.eclass,v 1.16 2009/03/12 04:29:09 vapier Exp $ # Author : Alastair Tse <liquidx@gentoo.org> (21 Jun 2003) # @@ -28,6 +28,7 @@ # # USE_RPMOFFSET_ONLY="1" +inherit eutils USE_RPMOFFSET_ONLY=${USE_RPMOFFSET_ONLY-""} @@ -93,4 +94,25 @@ rpm_src_unpack() { done } +# @FUNCTION: rpm_spec_epatch +# @USAGE: [spec] +# @DESCRIPTION: +# Read the specified spec (defaults to ${PN}.spec) and attempt to apply +# all the patches listed in it. If the spec does funky things like moving +# files around, well this won't handle that. +rpm_spec_epatch() { + local p spec=${1:-${PN}.spec} + local dir=${spec%/*} + grep '^%patch' "${spec}" | \ + while read line ; do + set -- ${line} + p=$1 + shift + EPATCH_OPTS="$*" + set -- $(grep "^P${p#%p}: " "${spec}") + shift + epatch "${dir:+${dir}/}$*" + done +} + EXPORT_FUNCTIONS src_unpack |