build-gnu.sh: Remove which for portability (#9452)

This commit is contained in:
oech3 2025-11-24 00:05:13 +09:00 committed by GitHub
parent b37da0a4b1
commit fdcceddfa9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -348,8 +348,8 @@ sed -i 's/not supported/unexpected argument/' tests/mv/mv-exchange.sh
# Most tests check that `/usr/bin/tr` is working correctly before running.
# However in NixOS/Nix-based distros, the tr util is located somewhere in
# /nix/store/xxxxxxxxxxxx...xxxx/bin/tr
# We just replace the references to `/usr/bin/tr` with the result of `$(which tr)`
sed -i 's/\/usr\/bin\/tr/$(which tr)/' tests/init.sh
# We just replace the references to `/usr/bin/tr`
sed -i 's/\/usr\/bin\/tr/$(command -v tr)/' tests/init.sh
# upstream doesn't having the program name in the error message
# but we do. We should keep it that way.