xfs/293: Make 'man' hard requirement
authorNikolay Borisov <nborisov@suse.com>
Tue, 23 May 2017 14:16:40 +0000 (17:16 +0300)
committerEryu Guan <eguan@redhat.com>
Tue, 23 May 2017 15:31:03 +0000 (23:31 +0800)
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>
common/config
tests/xfs/293

index 8211356c385fc284c5ac3246a63c92dc4b46bff0..eb5b36b0c5709a0f185825bbb65dfef8627fc0e9 100644 (file)
@@ -196,6 +196,7 @@ export XZ_PROG="`set_prog_path xz`"
 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.
index df44e98e74e8ef74e4faa66b93dc0854d1f07512..6ac08c6f0feddad8127b0355fcde2016a88fe267 100755 (executable)
@@ -46,9 +46,11 @@ _cleanup()
 _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 @@ esac
 _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