From owner-freebsd-ports@FreeBSD.ORG Sat Jan 12 20:14:04 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5664C2AF; Sat, 12 Jan 2013 20:14:04 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id DB3EA800; Sat, 12 Jan 2013 20:14:03 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.2.117.99]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.6/8.14.5) with ESMTP id r0CKDuLR090195 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 12 Jan 2013 20:13:56 GMT (envelope-from matthew@FreeBSD.org) DKIM-Filter: OpenDKIM Filter v2.7.4 smtp.infracaninophile.co.uk r0CKDuLR090195 Authentication-Results: smtp.infracaninophile.co.uk/r0CKDuLR090195; dkim=none reason="no signature"; dkim-adsp=none (insecure policy) Message-ID: <50F1C3FD.2060308@FreeBSD.org> Date: Sat, 12 Jan 2013 20:13:49 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Chris Rees Subject: Re: [pkgng] case-sensitive search? References: <50F04B95.3000301@lissyara.su> <50F0686A.9030600@lissyara.su> In-Reply-To: X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2VAWWBDADRWXIFIISAQVW" X-Virus-Scanned: clamav-milter 0.97.6 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk Cc: Alex Keda , FreeBSD Mailing List X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 20:14:04 -0000 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--