config

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

commit 818f16b2e23ccb824ae4ae5fec5ccc23b7bcb4d4
parent d622180f3c2ef54f8c1d7be77d69e7fe1c276104
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Tue, 20 Jul 2021 16:54:49 -0700

Improve portslist script

Limit output to ports for the current architecture and remove the
v flag (it's now always on).

Diffstat:
Mlocal/bin/.local/bin/portslist | 14++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/local/bin/.local/bin/portslist b/local/bin/.local/bin/portslist @@ -2,14 +2,8 @@ # Copyright 2021 Jacob R. Edwards # License: GPLv3 # -# portslist -- list OpenBSD ports (requires portslist) -# -# -v display extra information about the port - -list() tr "$@" '|' '\t' </usr/local/share/ports-INDEX +# portslist -- list OpenBSD ports for your arch (requires 'portslist' package) -if test "$1" = '-v'; then - shift && list | cut -f1,4 "$@" -else - list | cut -f1 "$@" -fi +awk -F '|' -v OFS='\t' -v arch="$(uname -p)" 'match($11, arch) || $11 = "any" { + print($1, $4); +}' /usr/local/share/ports-INDEX