I am now recovered from Thanksgiving and am proceeding
with finalizing rpmdb access with patterns, and speeding
up "rpm -qa" another order of magnitude.
I already have full blown pattern matching for PCRE patterns
applied to the RPMTAG_NAME index:
http://rpm5.org/community/rpm-devel/4012.html
What remains is to choose a pattern syntax, and apply to the
RPMTA_NVRA index instead.
I can easily do glob's or PCRE's or strcmp or ... for all rpm CLI
package (i.e. anything that is looked up in an rpmdb) arguments
if I can devise some means to infer what the input is.
ATM, the best I can think of is to use the presence of a leading '^'
or trailing '$' anchor as a positive confirmation that a
pattern, not a string, is intended, and the pattern will
not be escaped further.
If no anchors, I will add both anchors and whatever else
is needed to preserve the rather goosey-loosey legacy
behavior of RPM, where the V and R are optional, and A
is restricted to a known set of arch keywords, in
N-V-R.A
and escape all PCRE characters found in the string.
Any other ideas?
Should I dumb the implementation down to fnmatch(3)? The problem
with fnmatch(3) is that negative matches like "everything but"
as in "grep -v ..." don't work well enough with glob patterns.
73 de Jeff
Received on Fri Dec 4 17:05:04 2009