From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:43293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Ie8-0006Xy-B6 for guix-patches@gnu.org; Mon, 11 Mar 2019 06:59:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3Ie6-0005Nc-8l for guix-patches@gnu.org; Mon, 11 Mar 2019 06:59:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53349) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3Ie5-0005NE-Vt for guix-patches@gnu.org; Mon, 11 Mar 2019 06:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h3Ie5-0002yS-PG for guix-patches@gnu.org; Mon, 11 Mar 2019 06:59:01 -0400 Subject: [bug#34811] Make package name regexes case-insensitive Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:42277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3IdF-0005pD-FB for guix-patches@gnu.org; Mon, 11 Mar 2019 06:58:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3IQD-00036o-Pz for guix-patches@gnu.org; Mon, 11 Mar 2019 06:44:42 -0400 Received: from tobias.gr ([2001:470:7405::1]:51244) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3IQD-00034c-AI for guix-patches@gnu.org; Mon, 11 Mar 2019 06:44:41 -0400 Received: by tobias.gr (OpenSMTPD) with ESMTP id 6e900e7a for ; Mon, 11 Mar 2019 10:44:37 +0000 (UTC) Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 45bf3316 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Mon, 11 Mar 2019 10:44:37 +0000 (UTC) From: Tobias Geerinckx-Rice Date: Mon, 11 Mar 2019 11:44:35 +0100 Message-ID: <87ftrther0.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 34811@debbugs.gnu.org --=-=-= Content-Type: text/plain; format=flowed Guix, I think they should. All of our package names are lower case, and it doesn't add value that $ guix package -A ExifTool matches zero, zip, zilch, nada, nothing, while $ guix package -A exiftool perl-image-exiftool 11.11 out gnu/packages/photo.scm:208:2 does. Kind regards, T G-R --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-ui-Match-package-names-case-insensitively.patch Content-Transfer-Encoding: quoted-printable >From 5876eb1fe6d412d7f2a556e0903cd2d87994ab9e Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 11 Mar 2019 11:37:11 +0100 Subject: [PATCH] ui: Match package names case-insensitively. * guix/ui.scm (make-package-name-regexp): New variable. * guix/scripts/package.scm (options->upgrade-predicate, process-query): Use it. --- guix/scripts/package.scm | 9 +++++---- guix/ui.scm | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index efff511299..563615938b 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -6,6 +6,7 @@ ;;; Copyright =C2=A9 2016 Roel Janssen ;;; Copyright =C2=A9 2016 Benz Schenk ;;; Copyright =C2=A9 2016 Chris Marusich +;;; Copyright =C2=A9 2019 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -526,14 +527,14 @@ upgrading, #f otherwise." (define upgrade-regexps (filter-map (match-lambda (('upgrade . regexp) - (make-regexp* (or regexp ""))) + (make-package-name-regexp (or regexp ""))) (_ #f)) opts)) =20 (define do-not-upgrade-regexps (filter-map (match-lambda (('do-not-upgrade . regexp) - (make-regexp* regexp)) + (make-package-name-regexp regexp)) (_ #f)) opts)) =20 @@ -686,7 +687,7 @@ processed, #f otherwise." #t) =20 (('list-installed regexp) - (let* ((regexp (and regexp (make-regexp* regexp))) + (let* ((regexp (and regexp (make-package-name-regexp regexp))) (manifest (profile-manifest profile)) (installed (manifest-entries manifest))) (leave-on-EPIPE @@ -702,7 +703,7 @@ processed, #f otherwise." #t)) =20 (('list-available regexp) - (let* ((regexp (and regexp (make-regexp* regexp))) + (let* ((regexp (and regexp (make-package-name-regexp regexp))) (available (fold-available-packages (lambda* (name version result #:key outputs location diff --git a/guix/ui.scm b/guix/ui.scm index 2fc001d2eb..eb4ea28d52 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -13,6 +13,7 @@ ;;; Copyright =C2=A9 2013, 2014 Free Software Foundation, Inc. ;;; Copyright =C2=A9 2018 Sahithi Yarlagadda ;;; Copyright =C2=A9 2018 Ricardo Wurmus +;;; Copyright =C2=A9 2019 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -79,6 +80,7 @@ show-version-and-exit show-bug-report-information make-regexp* + make-package-name-regexp string->number* size->number show-derivation-outputs @@ -548,6 +550,10 @@ nicely." (leave (G_ "'~a' is not a valid regular expression: ~a~%") regexp message)))) =20 +(define (make-package-name-regexp regexp) + "Like 'make-regexp*' but specifically for package names (i.e. ignore cas= e)" + (make-regexp* regexp regexp/icase)) + (define (string->number* str) "Like `string->number', but error out with an error message on failure." (or (string->number str) --=20 2.20.1 --=-=-=--