From 216a42ca342eee926deaba575abd35ce781e003e Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Tue, 29 Sep 2026 20:46:57 +0900 Subject: [PATCH] show-utils.sh: remove dependency on dirname --- .github/workflows/freebsd.yml | 4 ++-- .github/workflows/openbsd.yml | 4 ++-- util/show-utils.sh | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 95a80c29893..09f996648a5 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -40,8 +40,8 @@ jobs: usesh: true sync: rsync copyback: false - # We need jq and GNU coreutils to run show-utils.sh and bash to use inline shell string replacement - prepare: pkg install -y rust sudo jaq coreutils bash python3 + # We need bash to use inline shell string replacement + prepare: pkg install -y rust sudo jaq bash python3 run: | ## Prepare, build, and test sudo ln -s $(command -v jaq) /usr/local/bin/jq diff --git a/.github/workflows/openbsd.yml b/.github/workflows/openbsd.yml index 73120728818..d804d27e12d 100644 --- a/.github/workflows/openbsd.yml +++ b/.github/workflows/openbsd.yml @@ -41,13 +41,13 @@ jobs: sync: rsync copyback: false mem: 4096 - # We need jq and GNU coreutils to run show-utils.sh and bash to use inline shell string replacement + # We need bash to use inline shell string replacement # Use sudo-- to get the default sudo package without ambiguity # Install rust and cargo from OpenBSD packages prepare: | # Clean up disk space before installing packages df -h - pkg_add curl sudo-- jq coreutils bash rust rust-clippy rust-rustfmt python3 + pkg_add curl sudo-- jq bash rust rust-clippy rust-rustfmt python3 rm -rf /usr/share/relink/* /usr/X11R6/* /usr/share/doc/* /usr/share/man/* & # Clean up package cache after installation pkg_delete -a & diff --git a/util/show-utils.sh b/util/show-utils.sh index c25be5968f3..d0371a427ae 100755 --- a/util/show-utils.sh +++ b/util/show-utils.sh @@ -3,7 +3,10 @@ set -eo pipefail # spell-checker:ignore (jq) deps startswith -cd -- "$(dirname -- "$0")/.." +# This script should not depend on external binaries to maximize portability if possible +dir="${0%/*}" +[ "$dir" = "$0" ] && dir="." +cd -- "$dir/.." # `jq` available? if ! jq --version 1>/dev/null 2>&1; then