Subject: [bug#34811] Make package name regexes case-insensitive

From: Ludovic Courtès <[email-masked]>
Date: Fri, 15 Mar 2019 23:11:11 +0100

Hello!

Tobias Geerinckx-Rice <[email-masked]>
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 <[email-masked]>
> 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’t think the abstraction brings much here; I’d prefer
‘regexp/icase’ to be inlined.  WDYT?

Otherwise LGTM, thanks!

Ludo’.