grf, sent this one earlier with wrong alias..
2011/1/25 Per Øyvind Karlsen <peroyv...@mandriva.org>:
> 2011/1/24 Jeff Johnson <n3...@mac.com>:
>> Lessess if we can get this "fixed".
>>
>> On Jan 19, 2011, at 8:39 PM, Per Øyvind Karlsen wrote:
>>>>
>>>>> To make dbiFindMatches() to match -%{disttag}%{distepoch}, I changed
>>>>> _post_NVRA to:
>>>>>
>>>>> static const char _post_NVRA[] =
>>>>> "(-[^-]+-[^-]+-[^-]+\\.[^.]+|-[^-]+-[^-]+\\.[^.]+|-[^-]+\\.[^.]+|\\.[^.]+|)$";
>>>>>
>>>>> This expression gets too greedy for packages with '-' in the name and
>>>>> without disttag/distepoch though..
>>>>>
>>>>
>>
>> There is something I don't understand here.
>>
>> Let's say a NVRA key looks like this
>>
>> foo-1.2-3mdv2011.0.noarch
>>
>> That might be a {N,V,R,A} 4-tuple, or that might be a {N,V,R,D,A} 5- or
>> 6-tuple.
>>
>> Either way the string is identical, and the existing _post_NVRA pattern
>> either "works" or doesn't.
>>
>> So where is this "too greedy" coming from? My guess is that you have
>> mixtures of strings in the NVRA index, some with "mdv2011.0", some without.
> Yupp, that's just it.
>>
>> Get rid of the mixture and you will get rid of the "too greedy".
> As disttag/distepoch is optional, it's not as easy as getting rid of
> packages without..
>
> Additional restrictions on allowed characters seems to be the way to go.
>
> I'm thinking something like this:
> %pattern_Disttag ^[a-z]+$
> %pattern_Distepoch ^[A-Z0-9.]+$
>
> Also a different character than '-' for separator, I don't have any
> specific character
> in mind myself yet though..
>
> --
> Regards,
> Per Øyvind
>
______________________________________________________________________
RPM Package Manager http://rpm5.org
Developer Communication List rpm-devel@rpm5.org