Hi guys,
Does anyone remember what the story behind PCP_WHICH_PROG is?
I have a platform here where the default setting (ie "type") is
giving "xxx is hashed (/usr/bin/xxx)" instead of "/usr/bin/xxx"
as output ... which is making for a broken diagnostic from rc
scripts.
There's a comment in _which() at the head of rc-proc.sh that is
probably highly relevant:
# some versions of which(1) have historically not reflected the
# correct exit status ... but it appears that all modern platforms
# get this correct
I'd like to make the change below but I'm a little unsure about
its potential impact... (hopefully this was an IRIX-ism?)
diff --git a/configure.ac b/configure.ac
index 520879c..b66ff56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -917,6 +917,11 @@ if test -z "$ECHO"; then
fi
echo=$ECHO
AC_SUBST(echo)
+if test -z "$WHICH"; then
+ AC_PATH_PROG(WHICH, which, /usr/bin/which)
+fi
+which=$WHICH
+AC_SUBST(which)
dnl check we don't get the Windows sort ...
AC_MSG_CHECKING([where unix-like sort(1) lives])
@@ -1064,17 +1069,6 @@ then
fi
AC_SUBST(grep)
-if test -n "$WHICH"
-then
- which=$WHICH
-elif sh -c 'type -p sh' >/dev/null 2>&1
-then
- which=type
-else
- which=which
-fi
-AC_SUBST(which)
-
dnl checks for /proc pseudo file system
AC_MSG_CHECKING([for /proc ])
if test "$cross_compiling" = "yes"; then
Thanks.
ps: How much which could a which which which if a which which
could which which?
--
Nathan
|