public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: rpm.eclass
       [not found] <E1LhcXd-0000Bc-Bk@stork.gentoo.org>
@ 2009-03-12 18:44 ` Donnie Berkholz
  2009-03-12 21:05   ` Mike Frysinger
  0 siblings, 1 reply; 2+ messages in thread
From: Donnie Berkholz @ 2009-03-12 18:44 UTC (permalink / raw
  To: gentoo-dev, vapier

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: rpm.eclass
  2009-03-12 18:44 ` [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: rpm.eclass Donnie Berkholz
@ 2009-03-12 21:05   ` Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2009-03-12 21:05 UTC (permalink / raw
  To: Donnie Berkholz; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-12 21:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1LhcXd-0000Bc-Bk@stork.gentoo.org>
2009-03-12 18:44 ` [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: rpm.eclass Donnie Berkholz
2009-03-12 21:05   ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox