RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Permitting patterns as rpm CLI arguments

From: Jeff Johnson <n3npq@mac.com>
Date: Fri 04 Dec 2009 - 23:35:12 CET
Message-id: <00AB6D27-8510-4323-9BC6-8C97529EBED1@mac.com>

On Dec 4, 2009, at 1:33 PM, Jeff Johnson wrote:

> 
> Well the deed is largely done:
> 

And now the patterns are applied to the RPMTAG_NVRA index:

$ /usr/bin/time rpm -q perl-5.10.0-82.fc11.i586
perl-5.10.0-82.fc11.i586
0.01user 0.05system 0:00.23elapsed 28%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+3347minor)pagefaults 0swaps
$ /usr/bin/time rpm -q perl-5.10.0-82.fc11
perl-5.10.0-82.fc11.i586
0.03user 0.06system 0:00.22elapsed 41%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+3336minor)pagefaults 0swaps
$ /usr/bin/time rpm -q perl-5.10.0
perl-5.10.0-82.fc11.i586
0.02user 0.05system 0:00.21elapsed 36%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+3331minor)pagefaults 0swaps
$ /usr/bin/time rpm -q perl
perl-5.10.0-82.fc11.i586
0.02user 0.06system 0:00.22elapsed 41%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+3337minor)pagefaults 0swaps

I've used this pattern, which matches full subfields at N-V-R.A boundaries:
    if (_post == NULL) _post = "(-[^-]+-[^-]+|-[^-]+|)\\.[^.]+$";
because that is the traditional behavior.

But the N-V-R.A boundary restriction could be relaxed in the default.

Meanwhile, you can always write your own patterns with '^' and/or '$' anchors,
so I'm not sure its worth fussing about Newer! Better! Bestest!

73 de Jeff
Received on Fri Dec 4 23:36:02 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.