[pkgng] case-sensitive search?
matthew at FreeBSD.org
Sat Jan 12 20:14:04 UTC 2013
On 12/01/2013 17:20, Chris Rees wrote:
> I've made a patch against pkgng HEAD, to add a -l option (just for pkg
> search currently) to use the SQL LIKE operator. This allows for case
> insensitivity. Perhaps it could just be default?
I like the idea of being able to do case insensitive searches, and I'm
open to the suggestion that it should be the default for 'pkg search' or
'pkg info'[*] but...
'pkg info' needs to remain some sort of compatibility with pkg_info for
now, and as it is used in several places (bsd.ports.mk, portmaster,
portupgrade) any change to the default behaviour would have to be well
tested against those applications.
'pkg search' lets you match packages by rather more than just name or
origin, and I think the same sort of case sensitive / insensitive choice
should be supported there.
In which case, I'd be tempted to use 'LIKE' for all those matching
tasks, replacing the plain MATCH using '=' entirely. Use the
case_sensitive_like pragma to toggle case sensitivity on or off as
according to what options are supplied. Would be good to have a
consistent option or options across all four of the querying commands,
which unfortunately rules out -l. Perhaps -u for 'case sensitve' / -U
for 'case insensitive'?
This means users could use the '%' and '_' wildcards if they wished --
although having that, *and* globbing expressions *and* regexps is
perhaps going slightly OTT.
[*] Case sensitive should remain the default for 'pkg query' or 'pkg
rquery' give those are intended more for scripting than interactive use.
Dr Matthew J Seaman MA, D.Phil.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 268 bytes
Desc: OpenPGP digital signature
More information about the freebsd-ports