Gentoo Archives: gentoo-dev

From: Donnie Berkholz <dberkholz@g.o>
To: gentoo-dev@l.g.o, vapier@g.o
Subject: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: rpm.eclass
Date: Thu, 12 Mar 2009 18:45:32
Message-Id: 20090312184421.GC17640@comet
1 On 04:29 Thu 12 Mar , Mike Frysinger (vapier) wrote:
2 > Modified: rpm.eclass
3 > Log:
4 > add a func to automatically process patches in rpm specs
5
6 > +# @FUNCTION: rpm_spec_epatch
7 > +# @USAGE: [spec]
8 > +# @DESCRIPTION:
9 > +# Read the specified spec (defaults to ${PN}.spec) and attempt to apply
10 > +# all the patches listed in it. If the spec does funky things like moving
11 > +# files around, well this won't handle that.
12 > +rpm_spec_epatch() {
13 > + local p spec=${1:-${PN}.spec}
14 > + local dir=${spec%/*}
15 > + grep '^%patch' "${spec}" | \
16 > + while read line ; do
17 > + set -- ${line}
18 > + p=$1
19 > + shift
20 > + EPATCH_OPTS="$*"
21 > + set -- $(grep "^P${p#%p}: " "${spec}")
22 > + shift
23 > + epatch "${dir:+${dir}/}$*"
24 > + done
25 > +}
26 > +
27
28 Very cool! How about adding this to a default src_prepare() for EAPI=2?
29
30 --
31 Thanks,
32 Donnie
33
34 Donnie Berkholz
35 Developer, Gentoo Linux
36 Blog: http://dberkholz.wordpress.com

Replies