Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jan 2013 20:13:49 +0000
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        Chris Rees <crees@FreeBSD.org>
Cc:        Alex Keda <admin@lissyara.su>, FreeBSD Mailing List <freebsd-ports@freebsd.org>
Subject:   Re: [pkgng] case-sensitive search?
Message-ID:  <50F1C3FD.2060308@FreeBSD.org>
In-Reply-To: <CADLo838Hy7o62wSAa%2BQs4fKfmmmp-762z3Tfp7h_8gYW9YBkaQ@mail.gmail.com>
References:  <50F04B95.3000301@lissyara.su> <CADLo83-HAVvCRUnTNBEXKHDEOtbHR8-9oi57_3y2sjeBgx9dtw@mail.gmail.com> <50F0686A.9030600@lissyara.su> <CADLo838Hy7o62wSAa%2BQs4fKfmmmp-762z3Tfp7h_8gYW9YBkaQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
------enig2VAWWBDADRWXIFIISAQVW
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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?
>=20
> http://www.bayofrum.net/~crees/patches/pkgng-like.diff

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 '=3D' entirely.  Use the
case_sensitive_like pragma to toggle case sensitivity on or off as
required (https://www.sqlite.com/pragma.html#pragma_case_sensitive_like)
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.

	Cheers,

	Matthew

[*] Case sensitive should remain the default for 'pkg query' or 'pkg
rquery' give those are intended more for scripting than interactive use.

--=20
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey



------enig2VAWWBDADRWXIFIISAQVW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEUEARECAAYFAlDxxAQACgkQ8Mjk52CukIzg0QCdGQ1EGWNBafYS76L48OurBZB7
ZkIAli8ENTSJXqwEZgHApyNMYrBVKNc=
=9xp5
-----END PGP SIGNATURE-----

------enig2VAWWBDADRWXIFIISAQVW--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50F1C3FD.2060308>