RPM Community Forums

Mailing List Message of <rpm-devel>

Fwd: Adding dependency alternation using glob expressions?

From: Jeff Johnson <n3npq@mac.com>
Date: Thu 25 Sep 2008 - 06:53:50 CEST
Message-id: <6715FF6F-0443-43F0-8224-1F7921304408@mac.com>


Begin forwarded message:

> From: Jeff Johnson <n3npq@mac.com>
> Date: September 25, 2008 12:09:55 AM EDT
> To: rpm-devel@rpm5.org
> Subject: Adding dependency alternation using glob expressions?
>
> rpm triggers with glob expressions are starting to congeal nicely.
>
> The basic trick to handle trigger patterns is/was a 2 level pass on  
> an rpmdb index.
>
> The first pass gathers all the keys in the index that are known,  
> the 2nd pass
> across existing primary keys gathers headers through secondary  
> retrieval.
>
> I can likely wire up the mechanism with an extra loop inside of  
> rpmdbInitIterator
> et al when the time comes ...
>
> So its time to identify the need and a usage case first:
>
> Let's say you want
> 	Requires: A
> or
> 	Requires: B
>
> The alternation above can be captured in a glob as
> 	Requires: @(A|B)
> either literally, or (if necessary) with some straightforward  
> transformation.
>
> Since discussing *.spec syntax is never straightforward, I'd  
> suggest permitting
> glob patterns into dependency names literally instead of thrashing  
> through
> the aesthetics of grammarless *.spec files.
>
> Note also that pattern alternation is not quite the same as  
> assertion alternation.
> I.e.
> 	Requires: A > 1. 0 || B > 2.0
> is not (at least easily) expressible with pattern alternation. But  
> the lack
> of assertion alternation is unrelated to whether pattern  
> alternation is useful.
>
> An open question is whether
> 	Requires: @(A|B) > 1.0
> is sufficiently useful to be permitted, or whether the syntax needs  
> to be explicitly forbidden.
>
> Opinions?
>
> 73 de Jeff
Received on Thu Sep 25 06:55:11 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.