RPM Community Forums

Mailing List Message of <rpm-devel>

Permitting patterns as rpm CLI arguments

From: Jeff Johnson <n3npq@mac.com>
Date: Fri 04 Dec 2009 - 17:04:40 CET
Message-id: <983EF917-E150-431C-970D-CE93652A14E4@mac.com>
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
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.