logo

utils-std

Collection of commonly available Unix tools
commit: e372efdd5c8e96be6b86b9e9e7be14813c11445b
parent 07241cdabd8845ad4ea331842672cbc1b7863743
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat,  4 May 2024 19:31:17 +0200

test-cmd/pathchk.t: glibc broken getconf workaround

Diffstat:

Mtest-cmd/pathchk.t12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/test-cmd/pathchk.t b/test-cmd/pathchk.t @@ -6,13 +6,17 @@ $ test "$(command -v pathchk)" = "$TESTDIR/../cmd/pathchk" +Thanks glibc for the broken getconf + $ POSIX_NAME_MAX=$(getconf _POSIX_NAME_MAX 2>/dev/null || echo 14) + $ POSIX_PATH_MAX=$(getconf _POSIX_PATH_MAX 2>/dev/null || echo 256) + $ pathchk "$(printf "foo/%*s/bar" "$(getconf NAME_MAX "$PWD")" | tr ' ' _)" $ pathchk "$(printf "foo/s%*s/bar" "$(getconf NAME_MAX "$PWD")" | tr ' ' _)" pathchk: Path component \([0-9]+ octets\) is over the maximum size \([0-9]+ octets\): s_+ (re) [1] - $ pathchk -p "$(printf "foo/%*s/bar" "$(getconf _POSIX_NAME_MAX)" | tr ' ' _)" - $ pathchk -p "$(printf "foo/s%*s/bar" "$(getconf _POSIX_NAME_MAX)" | tr ' ' _)" + $ pathchk -p "$(printf "foo/%*s/bar" "${POSIX_NAME_MAX}" | tr ' ' _)" + $ pathchk -p "$(printf "foo/s%*s/bar" "${POSIX_NAME_MAX}" | tr ' ' _)" pathchk: Path component \([0-9]+ octets\) is over the maximum size \([0-9]+ octets\): s_+ (re) [1] @@ -20,8 +24,8 @@ pathchk: Path \([0-9]+ octets\) is over the maximum size \([0-9]+ octets\): s/+ (re) [1] - $ pathchk -p "$(printf "%*s" "$(getconf _POSIX_PATH_MAX)" | tr ' ' /)" - $ pathchk -p "$(printf "s%*s" "$(getconf _POSIX_PATH_MAX)" | tr ' ' /)" + $ pathchk -p "$(printf "%*s" "${POSIX_PATH_MAX}" | tr ' ' /)" + $ pathchk -p "$(printf "s%*s" "${POSIX_PATH_MAX}" | tr ' ' /)" pathchk: Path \([0-9]+ octets\) is over the maximum size \([0-9]+ octets\): s/+ (re) [1]