commit a0a2763357ca552c27213e3dd7ead1635fda6d95 parent 07ae09badee2b1ada7ed25f4f39d7d459ec6ac52 Author: Jacob R. Edwards <jacobouno@protonmail.com> Date: Thu, 2 Sep 2021 15:51:08 -0700 Use the ports index for pkg_depend Using the ports index is faster and additionally doesn't require a network connection. Of course the portslist package must be installed instead. Diffstat:
| M | local/bin/bin/pkg_depend | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/local/bin/bin/pkg_depend b/local/bin/bin/pkg_depend @@ -4,5 +4,5 @@ # # pkg_depend -- view OpenBSD package dependancies -pkg_info -qv "${@:?No package.}" | awk -F'[ :]' '/^@name/ { name = $2 } -/^@depend/ { printf "%s\t%s\n", name, $NF }' +awk -vpkg="$(pkg_info -Iq "$1")" 'index($1, pkg) == 1' /usr/local/share/ports-INDEX | + cut -d'|' -f8 | tr ' ' '\n' | cut -d/ -f2