On Thursday 12 March 2009 14:44:21 Donnie Berkholz wrote:
> On 04:29 Thu 12 Mar , Mike Frysinger (vapier) wrote:
> > Modified: rpm.eclass
> > Log:
> > add a func to automatically process patches in rpm specs
> >
> > +# @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
> > +}
> > +
>
> Very cool! How about adding this to a default src_prepare() for EAPI=2?many specs do weird things like changing dirs/files/whatever, so i dont think making it a default is viable. especially when people only want rpm.elcass for rpm_unpack, not for rpm_src_unpack. -mike
signature.asc
Description: This is a digitally signed message part.
