On Sep 25, 2008, at 4:29 AM, devzero2000 wrote:
> On Thu, Sep 25, 2008 at 6:53 AM, Jeff Johnson <n3npq@mac.com> wrote:
>
>
> 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?
>
>
> I would be prefer to see implemented the first form anyway. The
> boolean dependency alternation as Requires: A > 1. 0 || B > 2.0 is
> more general that Requires: @(A|B) > 1.0. If i can use the first
> form the second isn't necessary nor useful. What is more
> implementing the first form will permit rpm5 to have finally also
> the "boolean or dependency" that sometime was requested. Perhaps it
> is the time to do.
>
I see pattern and assertion alternation as two distinct implementations.
There are usage cases for both.
And patterns might be useful with dependency EVR as well as N, at
least for
equality, if not < and >, comparisons. Equaility would be pattern
matches, inequality
is pattern does not match, when pattern is applied to EVR.
Howvere there will be large incompatibilities introduced by assertion
alternation,
not only in *.spec parsing, but also in how dependencies are represented
in packages.
My hunch is that the incompatibilities are so large that its not
worth actively
pursuing assertion alternation yet.
But pattern alternation, which is semantically identical to
unversion'ed assertion
alternation, can be added without introducing too much
incompatibility, and
starts to address, say, package naming irregularities with MySQL
Requires: [Mm][Yy][Ss][Qq][Ll]
or perhaps a more readable variant like
Requires: @(mysql|MySQL)
And the @(...) pattern could handle a dependency on a file that might
be installed
in one of several directories.
(aside Hmmm, the KSH glob pattern extensions, including "@(A|B)"
alternation, seems
to have vanished from glibc, perhaps to achieve POSIX compatibility.
I know the alternation
was implemented in glibc at some point in time because rpmcache used
the @(A|B) syntax.
The pattern syntax is still documented in ksh(1).
I think I already discovered this fact 9 months ago, but have forgot,
sigh.
> http://www.linux-archive.org/rpm-package-manager/46735-naive-
> question-boolean-dependency.html
>
> This evolution, joined to the negate dependency operator (https://
> lists.dulug.duke.edu/pipermail/rpm-devel/2007-May/002620.html),
> would allow rpm5 expressing all finally the boolean dependencies.
> And thus finally it would render archaic completely Joey Hess's
> claim ( with rpm5 some claim are already untrue IMHO) (http://
> joey.kitenet.net/pkg-comp/).
>
Nothing will render Joey Hess's comments archaic, he will just invent
new criteria
to make dpkg look good and nitpick details to make rpm look bad.
Hey, its on the Internet, it _MUST_ be true!
> However if it is not possibile to have again an agreement on the
> first forms the second one would be however useful, even if more
> limited semantically.
>
Let me finish permitting glob patterns in triggers, and then I'll
likely have
better suggestions for syntax. I personally find
Requires: @(A|B)
not too ugly.
Since mire is being used for the implementation, switching between
RE's or PCRE's or strcmp or globs
is rather trivial.
73 de Jeff
Received on Thu Sep 25 17:25:39 2008