config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit ff1b4d108508b84e10f98def68382af891368fc0
parent bad5b79a3b702ea3c437a4b3383b3a245ccf4bc3
Author: Jacob R. Edwards <n/a>
Date:   Thu, 17 Nov 2022 10:26:41 -0600

Case-insensitive matching in pkg_list

Diffstat:
Mlocal/bin/bin/pkg_list | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/local/bin/bin/pkg_list b/local/bin/bin/pkg_list @@ -13,17 +13,20 @@ function matchunless(s, re, unless) { BEGIN { re = "^any$|(^!?| )" arch "( |$)" for (i = 1; i <= ARGC; ++i) { - argv[i] = ARGV[i] + argv[i] = tolower(ARGV[i]) delete ARGV[i] } ARGC = 1 } { + name = tolower($1) + desc = tolower($4) + arch = tolower($11) for (i in argv) - if (!match($1, argv[i]) && !match($4, argv[i])) + if (!match(name, argv[i]) && !match(desc, argv[i])) next - if (NF != 14 || matchunless($11, re, "^!")) + if (NF != 14 || matchunless(arch, re, "^!")) print($1, $4); else print($1, $4 " (for " $11 "; not " arch ")");