GNU bug report logs - #34811
Make package name regexes case-insensitive

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Tobias Geerinckx-Rice <somebody@HIDDEN>; dated Mon, 11 Mar 2019 10:59:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 34811 <at> debbugs.gnu.org:


Received: (at 34811) by debbugs.gnu.org; 21 May 2019 14:52:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 21 10:52:02 2019
Received: from localhost ([127.0.0.1]:40555 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hT67V-0005zf-Sh
	for submit <at> debbugs.gnu.org; Tue, 21 May 2019 10:52:02 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34660)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1hT67Q-0005zN-Ca
 for 34811 <at> debbugs.gnu.org; Tue, 21 May 2019 10:52:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47148)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1hT67K-000835-6Q; Tue, 21 May 2019 10:51:50 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=40420 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1hT67J-0005m7-Mx; Tue, 21 May 2019 10:51:50 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Tobias Geerinckx-Rice <somebody@HIDDEN>
Subject: Re: [bug#34811] Make package name regexes case-insensitive
References: <87ftrther0.fsf@nckx> <874l833i0w.fsf@HIDDEN>
Date: Tue, 21 May 2019 16:51:48 +0200
In-Reply-To: <874l833i0w.fsf@HIDDEN> ("Ludovic
 \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\=
 \=\?utf-8\?Q\?s\?\= message of "Fri, 15 Mar 2019 23:11:11 +0100")
Message-ID: <87r28rzwqj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 34811
Cc: 34811 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ping!

Ludovic Court=C3=A8s <ludo@HIDDEN> skribis:

> Hello!
>
> Tobias Geerinckx-Rice <somebody@HIDDEN>
> skribis:
>
>> 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.
>
> Indeed.
>
>>>>From 5876eb1fe6d412d7f2a556e0903cd2d87994ab9e Mon Sep 17 00:00:00 2001
>> From: Tobias Geerinckx-Rice <me@HIDDEN>
>> 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.
>
> [...]
>
>> -                   (make-regexp* (or regexp "")))
>> +                   (make-package-name-regexp (or regexp "")))
>
> I don=E2=80=99t think the abstraction brings much here; I=E2=80=99d prefer
> =E2=80=98regexp/icase=E2=80=99 to be inlined.  WDYT?
>
> Otherwise LGTM, thanks!
>
> Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#34811; Package guix-patches. Full text available.

Message received at 34811 <at> debbugs.gnu.org:


Received: (at 34811) by debbugs.gnu.org; 15 Mar 2019 22:11:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 15 18:11:21 2019
Received: from localhost ([127.0.0.1]:45573 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h4v2v-0004eZ-Lg
	for submit <at> debbugs.gnu.org; Fri, 15 Mar 2019 18:11:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:50382)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1h4v2t-0004eL-39
 for 34811 <at> debbugs.gnu.org; Fri, 15 Mar 2019 18:11:19 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50599)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1h4v2n-000593-Jo; Fri, 15 Mar 2019 18:11:13 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59414 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1h4v2m-0005XH-VK; Fri, 15 Mar 2019 18:11:13 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Tobias Geerinckx-Rice <somebody@HIDDEN>
Subject: Re: [bug#34811] Make package name regexes case-insensitive
References: <87ftrther0.fsf@nckx>
Date: Fri, 15 Mar 2019 23:11:11 +0100
In-Reply-To: <87ftrther0.fsf@nckx> (Tobias Geerinckx-Rice's message of "Mon,
 11 Mar 2019 11:44:35 +0100")
Message-ID: <874l833i0w.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 34811
Cc: 34811 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello!

Tobias Geerinckx-Rice <somebody@HIDDEN>
skribis:

> 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.

Indeed.

>>From 5876eb1fe6d412d7f2a556e0903cd2d87994ab9e Mon Sep 17 00:00:00 2001
> From: Tobias Geerinckx-Rice <me@HIDDEN>
> 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.

[...]

> -                   (make-regexp* (or regexp "")))
> +                   (make-package-name-regexp (or regexp "")))

I don=E2=80=99t think the abstraction brings much here; I=E2=80=99d prefer
=E2=80=98regexp/icase=E2=80=99 to be inlined.  WDYT?

Otherwise LGTM, thanks!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#34811; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Mar 2019 10:58:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 11 06:58:23 2019
Received: from localhost ([127.0.0.1]:38660 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h3IdP-0002xN-UD
	for submit <at> debbugs.gnu.org; Mon, 11 Mar 2019 06:58:23 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56148)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <somebody@HIDDEN>)
 id 1h3IdM-0002x7-Gl
 for submit <at> debbugs.gnu.org; Mon, 11 Mar 2019 06:58:18 -0400
Received: from lists.gnu.org ([209.51.188.17]:33443)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71)
 (envelope-from <somebody@HIDDEN>)
 id 1h3IdH-0004ab-4o
 for submit <at> debbugs.gnu.org; Mon, 11 Mar 2019 06:58:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42277)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <somebody@HIDDEN>)
 id 1h3IdF-0005pD-FB
 for guix-patches@HIDDEN; Mon, 11 Mar 2019 06:58:10 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <somebody@HIDDEN>)
 id 1h3IQD-00036o-Pz
 for guix-patches@HIDDEN; 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 <somebody@HIDDEN>)
 id 1h3IQD-00034c-AI
 for guix-patches@HIDDEN; Mon, 11 Mar 2019 06:44:41 -0400
Received: by tobias.gr (OpenSMTPD) with ESMTP id 6e900e7a
 for <guix-patches@HIDDEN>; 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 <guix-patches@HIDDEN>; Mon, 11 Mar 2019 10:44:37 +0000 (UTC)
From: Tobias Geerinckx-Rice <somebody@HIDDEN>
To: guix-patches@HIDDEN
Subject: Make package name regexes case-insensitive
Date: Mon, 11 Mar 2019 11:44:35 +0100
Message-ID: <87ftrther0.fsf@nckx>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2001:470:7405::1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

--=-=-=
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 <me@HIDDEN>
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 <roel@HIDDEN>
 ;;; Copyright =C2=A9 2016 Benz Schenk <benz.schenk@HIDDEN>
 ;;; Copyright =C2=A9 2016 Chris Marusich <cmmarusich@HIDDEN>
+;;; Copyright =C2=A9 2019 Tobias Geerinckx-Rice <me@HIDDEN>
 ;;;
 ;;; 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 <sahi@HIDDEN>
 ;;; Copyright =C2=A9 2018 Ricardo Wurmus <rekado@HIDDEN>
+;;; Copyright =C2=A9 2019 Tobias Geerinckx-Rice <me@HIDDEN>
 ;;;
 ;;; 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


--=-=-=--




Acknowledgement sent to Tobias Geerinckx-Rice <somebody@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#34811; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.