config

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

commit 29b2bcd4e2b3f70149783ddca0e36f8a6ec7a3c9
parent fe4243635c875b80889fd6a8d8f4788026d2c1d0
Author: Jacob R. Edwards <n/a>
Date:   Fri,  9 Dec 2022 11:18:50 -0600

Fix pkg_list architecture being overwritten

While the packages listed do not change, the message displayed when
they're not on your architecture was incorrect. For example, when
a package for powerpc only appears and your on amd64, this message
should appear

	for powerpc; not amd64

yet it would be

	for powerpc; not powerpc

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

diff --git a/local/bin/bin/pkg_list b/local/bin/bin/pkg_list @@ -4,14 +4,14 @@ # # List OpenBSD ports for your arch (requires 'portslist' package) -awk -F '|' -v OFS=' ' -v arch="$(uname -p)" ' +awk -F '|' -v OFS=' ' -v myarch="$(uname -p)" ' function matchunless(s, re, unless) { _ = match(s, re) return match(s, unless) ? !_: _ } BEGIN { - re = "^any$|(^!?| )" arch "( |$)" + re = "^any$|(^!?| )" myarch "( |$)" for (i = 1; i <= ARGC; ++i) { argv[i] = tolower(ARGV[i]) delete ARGV[i] @@ -29,5 +29,5 @@ BEGIN { if (NF != 14 || matchunless(arch, re, "^!")) print($1, $4); else - print($1, $4 " (for " $11 "; not " arch ")"); + print($1, $4 " (for " $11 "; not " myarch ")"); }' "$@" < /usr/local/share/ports-INDEX