RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Perl Requirement Munging...the RPM5 Way?

From: Jeff Johnson <n3npq@mac.com>
Date: Mon 21 Apr 2008 - 20:54:02 CEST
Message-Id: <B915700E-E7AF-4A27-88BA-CE1234AEA1B3@mac.com>

On Apr 21, 2008, at 2:15 PM, James Olin Oden wrote:

>>> What's more generally needed is a set of patterns applied to filter
>>> _ALL_ dependencies. PLD has one of these thingies (they're always
>>> first ;-) but now that rpmio/mire.c appears largely finished,
>>> there's a better mechanism to filter _ALL_ deps.
>>
>>  That would certainly address the issues my cited examples are trying
>>  to solve. :)
>>
> In a straight forward, and some would say intuitive way.  I like  
> it...james

Just in case anyone feels like hacking, there are code snippets in  
rpmio/rpmgrep.c
written for the purpose of providing an example of how to use the  
mire API.

rpmgrep has both --exclude and --include patterns on paths. Presumably
one can walk the popt code and find the mire initialization and  
loading without too
much difficulty.

What is subtle (and I may need to change) is the application of the  
patterns.

Here is the snippet that applies sets of --exclude/--include patterns  
to paths within
the per-file loop used in rpmgrep (from rpmio/rpmgrep.c:1001)

/*@-onlytrans@*/
                 if (mireApply(excludeMire, nexcludes, buffer, 0, -1)  
 >= 0)
                     continue;

                 if (mireApply(includeMire, nincludes, buffer, 0, +1)  
< 0)
                     continue;
/*@=onlytrans@*/

The same code is in several other places in the toy programs I wrote  
over the last 2 months.

Dependency filtering is just different content and patterns than path  
filtering, duh.

73 de Jeff
Received on Mon Apr 21 20:54:54 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.