xfs/293: Make 'man' hard requirement

If xfs/293 is run on a system which doesn't have 'man' installed
it will hang the due to $CAT waiting for input indefinitely. Also
create an entry for $MAN_PROG and use the cached $MANPAGE instead
of repeatedy calling $MAN_PROG --page

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
diff --git a/common/config b/common/config
index 8211356..eb5b36b 100644
--- a/common/config
+++ b/common/config
@@ -196,6 +196,7 @@
 export FLOCK_PROG="`set_prog_path flock`"
 export LDD_PROG="`set_prog_path ldd`"
 export TIMEOUT_PROG="`set_prog_path timeout`"
+export MAN_PROG="`set_prog_path man`"
 
 # use 'udevadm settle' or 'udevsettle' to wait for lv to be settled.
 # newer systems have udevadm command but older systems like RHEL5 don't.
diff --git a/tests/xfs/293 b/tests/xfs/293
index df44e98..6ac08c6 100755
--- a/tests/xfs/293
+++ b/tests/xfs/293
@@ -46,9 +46,11 @@
 _supported_fs xfs
 _supported_os IRIX Linux
 
+_require_command "$MAN_PROG" man
+
 echo "Silence is golden"
 
-MANPAGE=`man --path xfs_io`
+MANPAGE=`$MAN_PROG --path xfs_io`
 
 case "$MANPAGE" in
 *.gz|*.z\|*.Z)	CAT=zcat;;
@@ -60,7 +62,7 @@
 _require_command `which $CAT` $CAT
 
 for COMMAND in `$XFS_IO_PROG -c help | awk '{print $1}' | grep -v "^Use"`; do
-  $CAT `man --path xfs_io` | egrep -q "^\.B.*$COMMAND" || \
+  $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \
 	echo "$COMMAND not documented in the xfs_io manpage"
 done