Filtering requires/provides

Ralf Corsepius rc040203 at
Thu Mar 2 04:35:30 UTC 2006

On Wed, 2006-03-01 at 22:05 +0200, Ville Skyttä wrote:
> On Wed, 2006-03-01 at 17:26 +0000, Paul Howarth wrote:
> > %global filtered_requires sh -c '%{__perl_requires} "$@" | %{__sed} -e 
> > "/^perl(unwanted_require)$/d"'
> > %define __perl_requires %{filtered_requires}
> > 
> > Anyone see any problems with this?
> I don't see any technical problems offhand,
It'll get very ugly if having to use escapes, and more complex sed

>  but it'll sure get ugly when
> one needs to filter many provides/requires because IIRC the whole
> "%global ..." shebang needs to be on one line.
I prefer the current version, because the script inside is
plain /bin/shell without any escapes. This is less error prone in more
complex situations.

The only nastiness about the current implementation, I see, is it
relying on the %define being sequentially expanded inside of the spec.
This is likely to break in rpms which contain subpackages with diverging
"Versions:", similar to

Name:	 a
Version: x
Source0: a-sub1-x.tar.gz
Source1: a-sub2-y.tar.gz
%package sub1
Version: x
%package sub2
Version: y

I am facing such kind of %version related issues in a non-perl package,
which applies a customized find-requires, being generated on-the-fly.


More information about the Fedora-perl-devel-list mailing list