opkg

statically linked package installer
git clone anongit@rnpnr.xyz:opkg.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

Commit: f75f33b9646636d207836bc77215e6045925cfd0
Parent: 62c5a34c94dc986cf8103c7a9e2f081b24f31327
Author: Randy Palamar
Date:   Wed, 27 Dec 2023 10:28:58 -0700

use xargs from OpenBSD

sbase xargs is missing some useful but not POSIX options like -P
(parallel mode). Also, despite supporting more options, OpenBSD
xargs is actually smaller than sbase xargs.

Diffstat:
Mpkg/sys/openbsd/fetch.sh | 1+
Mpkg/sys/openbsd/gen.lua | 5+++++
Apkg/sys/openbsd/patch/0041-xargs-avoid-using-sys_signames-table.patch | 31+++++++++++++++++++++++++++++++
Mpkg/sys/sbase/gen.lua | 1-
4 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/pkg/sys/openbsd/fetch.sh b/pkg/sys/openbsd/fetch.sh @@ -27,6 +27,7 @@ sh "$OLDPWD/scripts/extract.sh" src.tar.gz -s ',^,src/,' \ 'usr.bin/nc/*' \ 'usr.bin/patch/*' \ 'usr.bin/rsync/*' \ + 'usr.bin/xargs/*' \ 'usr.bin/yacc/*' \ 'usr.sbin/acme-client/*' sh "$OLDPWD/scripts/extract.sh" sys.tar.gz -s ',^,src/,' 'sys/sys/*' diff --git a/pkg/sys/openbsd/gen.lua b/pkg/sys/openbsd/gen.lua @@ -102,4 +102,9 @@ exe('rsync', [[ file('bin/rsync', '755', '$outdir/rsync') man({'usr.bin/rsync/rsync.1', 'usr.bin/rsync/rsync.5', 'usr.bin/rsync/rsyncd.5'}) +-- xargs +exe('xargs', [[usr.bin/xargs/(xargs.c strnsubst.c) libbsd.a]]) +file('bin/xargs', '755', '$outdir/xargs') +man({'usr.bin/xargs/xargs.1'}) + fetch('local') diff --git a/pkg/sys/openbsd/patch/0041-xargs-avoid-using-sys_signames-table.patch b/pkg/sys/openbsd/patch/0041-xargs-avoid-using-sys_signames-table.patch @@ -0,0 +1,31 @@ +From 5f949b35a10b496bae09de3d30c62580c39e3cf7 Mon Sep 17 00:00:00 2001 +From: Randy Palamar <randy@rnpnr.xyz> +Date: Wed, 27 Dec 2023 09:24:34 -0700 +Subject: [PATCH] xargs: avoid using sys_signames table + +--- + usr.bin/xargs/xargs.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c +index ff17caa..18942bb 100644 +--- a/usr.bin/xargs/xargs.c ++++ b/usr.bin/xargs/xargs.c +@@ -581,12 +581,8 @@ waitchildren(const char *name, int waitall) + } + } else if (WIFSIGNALED(status)) { + if (WTERMSIG(status) != SIGPIPE) { +- if (WTERMSIG(status) < NSIG) +- warnx("%s terminated by SIG%s", name, +- sys_signame[WTERMSIG(status)]); +- else +- warnx("%s terminated by signal %d", +- name, WTERMSIG(status)); ++ warnx("%s terminated by signal %d", ++ name, WTERMSIG(status)); + } + exit(125); + } +-- +2.42.0 + diff --git a/pkg/sys/sbase/gen.lua b/pkg/sys/sbase/gen.lua @@ -166,7 +166,6 @@ local cmds = { 'wc', 'which', 'whoami', - 'xargs', 'yes', } for _, cmd in ipairs(cmds) do