RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Generalizing EVR comparison precedence, preliminaries

From: Jeff Johnson <n3npq@mac.com>
Date: Fri 02 Jan 2009 - 02:13:11 CET
Message-id: <BAC9AA82-B519-42AA-856B-0098CE7D6E62@mac.com>

On Jan 1, 2009, at 6:47 PM, Jeff Johnson wrote:

>
> On Jan 1, 2009, at 1:04 PM, Ralf S. Engelschall wrote:
>
>>>
>>> A little help vetting the RE's please ;-) My eyes are already tired
>>> from writing the toy script, RE's are more effective than XML at eye
>>> gouging.
>>
>> I propose the following three entries in "macros"...
>>
>>   # STEP 1: Match the string and capture regex parts
>>   #                      1          2           3             4
>>   #                      X     ":"  X        "-"X          ":"X
>>   %evr_tuple_match  ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-] 
>> +))?$
>
> A little more help please.
>
> I'm using POSIX extended RE's.
>
> With a single call to regexec(3), I'm seeing only 1 {rm_so, rm_eo}  
> matched substring
> returned.
>

Ah, here's at least part of my problem. I wasn't expecting sparsely  
populated
{rm_so,rm_eo} string offset arrays being returned:

==> xx 0 "3.0.4-1"
        0 [0,5) "3.0.4"
        2 [0,5) "3.0.4"
==> xx 0 "4.0-1"
        0 [0,3) "4.0"
        2 [0,3) "4.0"

But I'm not seeing anything but a single pattern match:

==> xx 0 "4:5.10.0-49.fc10"
        0 [0,1) "4"
        2 [0,1) "4"
==> xx 0 "0:5.005"
        0 [0,1) "0"
        2 [0,1) "0"

What do I miss?

73 de Jeff

  • application/pkcs7-signature attachment: smime.p7s
Received on Fri Jan 2 02:13:26 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.