Jim Meyering wrote:
Here are some minor changes I expect to merge into your commit.
I'll post a complete patch for your ACK before I push it.
(btw, your patch did not apply via "git am FILE"
due to fuzz in the init.cfg patch, but I managed
by applying with patch, pasting your log into ChangeLog
and running vc-dwim --commit. However that failed
due to a typo fixed via s/writeable/writable.)
diff --git a/tests/init.cfg b/tests/init.cfg
index bbd576c..4565907 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -180,18 +180,17 @@ uid_is_privileged_()
esac
}
-# Some distributions do not add /sbin to PATH for non-root users.
+# Some distributions do not include /sbin in the sudo-to-root PATH.
# Test if mkfs is in PATH, otherwise try to adapt PATH.
require_mkfs_PATH_()
{
- which mkfs>/dev/null 2>&1 \
-&& return
+ type mkfs&& return
case ":$PATH:" in
*:/sbin:*) skip_ "no usable mkfs found" ;;
esac
- [ -x /sbin/mkfs ] \
+ test -x /sbin/mkfs \
|| skip_ "no usable mkfs found"
Explaining the code changes above:
"which" is not portable, so we use the "type" built-in instead.
coreutils tests consistently use "test ARGS..." rather
than "[ ARGS... ]" because I prefer the former syntax.
With it, there is no need to ensure that there is a matching "]".