Ticket #3730: 3730-0014-extfs-urar-dont-invoke-rar-when-running-under-the-tester.patch

File 3730-0014-extfs-urar-dont-invoke-rar-when-running-under-the-tester.patch, 1.4 KB (added by mooffie, 8 years ago)
  • src/vfs/extfs/helpers/urar.in

    From 4afbee67cc7379bf9b7ff5ac308c4ac93381995d Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Mon, 19 Dec 2016 15:11:20 +0200
    Subject: [PATCH] Ticket #3730: 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...)
    ---
     src/vfs/extfs/helpers/urar.in | 13 +++++++++----
     1 file changed, 9 insertions(+), 4 deletions(-)
    
    diff --git a/src/vfs/extfs/helpers/urar.in b/src/vfs/extfs/helpers/urar.in
    index 35d0fca..5453d31 100644
    a b UNRAR=`which unrar 2>/dev/null` 
    2121[ -z $UNRAR ] && UNRAR=$RAR 
    2222[ ! -x $UNRAR -a -x $RAR ] && UNRAR=$RAR 
    2323 
    24 # Define $UNRAR version 
    25 UNRAR_VERSION=`$UNRAR -cfg- -? | grep "Copyright" | sed -e 's/.*\([0-9]\)\..*/\1/'` 
    26  
    2724# Let the test framework hook in: 
    2825UNRAR=${MC_TEST_EXTFS_LIST_CMD:-$UNRAR} 
    29 UNRAR_VERSION=${MC_TEST_EXTFS_UNRAR_VERSION:-$UNRAR_VERSION} 
     26 
     27# Determine the $UNRAR version 
     28if [ -n "$MC_TEST_EXTFS_UNRAR_VERSION" ]; then 
     29  # Let the test framework fool us: 
     30  UNRAR_VERSION=$MC_TEST_EXTFS_UNRAR_VERSION 
     31else 
     32  # Figure it out from rar itself: 
     33  UNRAR_VERSION=`$UNRAR -cfg- -? | grep "Copyright" | sed -e 's/.*\([0-9]\)\..*/\1/'` 
     34fi 
    3035 
    3136mcrar4fs_list () 
    3237{