On Sun, Dec 21, 2008, Jeff Johnson wrote:

> [...]
> The OpenPKG patch attempts to be more general than
> the suffix wildcard example I gave, and so has
> some peculierness associated if embedded, not
> appended, within a V or R string.
>
> The following character, not the following character class, is used to find
> the next matchpoint to continue with:
>
> #if defined(RPM_VENDOR_OPENPKG) /* support-wildcards-in-EVR-comparison */
>         if (a[0] == '*') {
>             ae = a + 1;
>             if ((be = strchr(b, a[1])) == NULL)
>                 be = b;
>         }
>         else if (b[0] == '*') {
>             be = b + 1;
>             if ((ae = strchr(a, b[1])) == NULL)
>                 ae = a;
>         }
>         else
> #endif
>
> That is easily fixed with a loop instead of using strchr, moving
> the other string match point over characters until a match
> in same character class can be attempted.
>
> There's also the issue of rpmdb EVR lookups that won't be quite
> right when a '*' is used is used in the retrieval key, and there's a slight
> chance of scwewiness with escaped RE chars in one or two
> places off the top of my head.
>
> But trigger EVR's already can support patterns and lookups, the only
> additional complexity (and unsupported with trigger pattern
> matching as well, so needs fixing) is that character classes
> willl need the '-' character within, say "[a-z]" or "[0-9]" character
> classes special cased, not particularly hard to parse.

Jeff, please feel free to adjust this stuff to better fit your needs.
For OpenPKG I actually just need the special case where a whole "V" is
matched by a single "*", i.e., "foo >= *-1.2.3". This currently is the
only functionality I really care about. So, as long as this is still
possible, please feel free to adjust the whole stuff as much as possible
and to the maximum extend it is useful for RPM in general. No problem
if you make it completely different or break it, except the "foo >=
*-1.2.3" case for which this was originally invented...

                                       Ralf S. Engelschall
                                       r...@engelschall.com
                                       www.engelschall.com

______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        rpm-devel@rpm5.org

Reply via email to