diff --git a/configure.ac b/configure.ac
   index 017d0ac..14dd6e3 100644
   --- a/configure.ac
   +++ b/configure.ac
   @@ -129,6 +129,9 @@ AC_ISC_POSIX
    AC_PROG_CC
    gl_EARLY
    AC_CHECK_TOOL(AR, ar)
   +AC_PATH_PROG(DD, dd, dd)
   +AC_PATH_PROG(MKTEMP, mktemp, mktemp)
   +AC_PATH_PROG(NETSTAT, netstat, netstat)

What about if those are missing?  The third argument is the value when
the program could not be found, so I would think that using the
`missing' script would be appropriate here.

    AC_PATH_PROG(RM, rm, rm)
    AC_PROG_CPP
    AC_PROG_INSTALL
   @@ -136,8 +139,13 @@ AC_PROG_MAKE_SET
    AC_PROG_RANLIB
    AC_PROG_YACC
    AC_PROG_LN_S
   +AC_PROG_SED
    AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
   -
   +AC_ARG_VAR(GREP, [Preferred grep(1) utility.])
   +AC_ARG_VAR(SED, [Preferred sed(1) utility.])
   +AC_ARG_VAR(DD, [Path to dd(1).])
   +AC_ARG_VAR(MKTEMP, [Path to mktemp(1).])
   +AC_ARG_VAR(NETSTAT, [Path to netstat(8).])

Please say `file name' (two words) instead of path, a path in GNU is a
search list, e.g. PATH, LD_LIBRARY_PATH, etc.  I'd skip the (8) stuff,
we use info in GNU not man pages so those are kinda meaningless, if it
is important to point to the documentation we can use `(coreutils) id
invocation'.  The docstring might even be simplified `netstat command'
or something.

   diff --git a/tests/tools.sh.in b/tests/tools.sh.in
   new file mode 100644
   index 0000000..a18a16d
   --- /dev/null
   +++ b/tests/tools.sh.in
   @@ -0,0 +1,16 @@
   +GREP=@GREP@
   +SED=@SED@
   +DD=@DD@
   +MKTEMP=@MKTEMP@
   +NETSTAT=@NETSTAT@
   +
   +# Some Solaris variants provide id(1) lacking `-u' switch.
   +# Work around this by some computation.
   +
   +func_id_uid () {
   +    id $1 | $SED -n 's,.*uid=\([0-9]*\).*,\1,p'
   +}
   +
   +func_id_user () {
   +    id $1 | $SED -n 's,.*uid=[0-9]*(\([^)]*\).*,\1,p'
   +}

Would it maybe be better to provide a wrapper around id instead? So
that `id -u' always works (or $ID).  I'm thinking something along the
lines of,


id()
{
  case $1 in
    -u) if id_without_u_p; then
          command id $1 | $SED -n 's,.*uid=\([0-9]*\).*,\1,p'
        fi
        break
    default)
      command id -u
  esac
}

Reply via email to