Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   gentoo-x86 commit in eclass: rpm.eclass (http://www.linux-archive.org/gentoo-development/262156-gentoo-x86-commit-eclass-rpm-eclass.html)

Donnie Berkholz 03-12-2009 05:44 PM

gentoo-x86 commit in eclass: rpm.eclass
 
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?

--
Thanks,
Donnie

Donnie Berkholz
Developer, Gentoo Linux
Blog: http://dberkholz.wordpress.com

Mike Frysinger 03-12-2009 08:05 PM

gentoo-x86 commit in eclass: rpm.eclass
 
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


All times are GMT. The time now is 08:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.