extfs: urar: don't invoke 'rar' when running under the tester.

We want to prevent messages printed to STDERR when running the tester on
systems where rar is not installed.

(Yes, we could compress this new code to just one line, but...)

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Mooffie 2016-12-19 15:11:20 +02:00 committed by Andrew Borodin
parent 2c17c7d28b
commit b8f7018725

View File

@ -21,12 +21,17 @@ UNRAR=`which unrar 2>/dev/null`
[ -z $UNRAR ] && UNRAR=$RAR [ -z $UNRAR ] && UNRAR=$RAR
[ ! -x $UNRAR -a -x $RAR ] && UNRAR=$RAR [ ! -x $UNRAR -a -x $RAR ] && UNRAR=$RAR
# Define $UNRAR version
UNRAR_VERSION=`$UNRAR -cfg- -? | grep "Copyright" | sed -e 's/.*\([0-9]\)\..*/\1/'`
# Let the test framework hook in: # Let the test framework hook in:
UNRAR=${MC_TEST_EXTFS_LIST_CMD:-$UNRAR} UNRAR=${MC_TEST_EXTFS_LIST_CMD:-$UNRAR}
UNRAR_VERSION=${MC_TEST_EXTFS_UNRAR_VERSION:-$UNRAR_VERSION}
# Determine the $UNRAR version
if [ -n "$MC_TEST_EXTFS_UNRAR_VERSION" ]; then
# Let the test framework fool us:
UNRAR_VERSION=$MC_TEST_EXTFS_UNRAR_VERSION
else
# Figure it out from rar itself:
UNRAR_VERSION=`$UNRAR -cfg- -? | grep "Copyright" | sed -e 's/.*\([0-9]\)\..*/\1/'`
fi
mcrar4fs_list () mcrar4fs_list ()
{ {