RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/ CHANGES rpm/lib/ rpmgi.c rpmgi.h rpminstall.c tgi.c

From: Jeff Johnson <n3npq@mac.com>
Date: Sun 03 Feb 2008 - 14:25:42 CET
Message-Id: <CC9E3614-692E-4B12-A964-0EA02CC8DE8A@mac.com>

On Feb 3, 2008, at 3:12 AM, Ralf S. Engelschall wrote:

> On Sat, Feb 02, 2008, Jeff Johnson wrote:
>
>>     static const char * pkgpat = "-[^-]*-[^-]*.[^.]*.rpm$";
>
> Your pattern would also match e.g. "--xxrpm" and hence is
> certainly still too weak. The first is to fix it via...
>
>    "-[^-]+-[^-]+\\.[^.]+\\.rpm$"
>
> ...as you don't want empty version, release and architecture and  
> the dot
> should be a literal one. Now fixed on HEAD. Second, the architecture
> part at least in OpenPKG can even contain dots, so I think we should
> make this regex also configurable via a macro. I'll try an attempt...
>

Thanks for the fixing.

Note that I'm likely to switch to fts(3) with only a RE in the
path in order to have multiple repository roots. Multiple
directories for armored pubkeys and binary keyrings is needed too.

>> If glob output is not filtered, then there are confusions between,  
>> say,
>> glibc-*.rpm and glibc-common-*.rpm returned from a glob.
>>
>> I finally ended up applying the RE pattern to filter the glob  
>> output so
>> that
>> I could get an initial implementation in place.
>>
>> Anyone got a better glob expression to use? The internal GNU glob in
>> rpm also supports ksh fnmatch extensions, if that matters.
>>
>> Bleeping uglix hurts my head sometimes, sigh.
>
> I don't think you have to improve the glob. It is fully fine to  
> first do
> the globbing and then the filtering. The regex is what has to be more
> precise and preferably even customizable.
>

The question is more intellectual than practical:
     Can a glob be written that ... ?

>>>   +static const char * rpmcliInstallElementPath(rpmts ts, const  
>>> char *
>>> arg)
>>>   +{
>>>   +    static const char * pkgpat = "-[^-]*-[^-]*.[^.]*.rpm$";
>>>   +    const char * mirePattern = rpmExpand(&arg[1], pkgpat, NULL);
>
> I think this should be "&arg[0]" or just "arg", shouldn't it?
>

Cut-n-paste error ...

73 de Jeff
Received on Sun Feb 3 14:25:51 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.