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>
This commit is contained in:
Nikolay Borisov
2017-05-23 17:16:40 +03:00
committed by Eryu Guan
parent b14d1bb8b3
commit 2d77f85806
2 changed files with 5 additions and 2 deletions
+1
View 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.
+4 -2
View File
@@ -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