Ticket #3744: 3744-0001-extfs-u7z-make-it-testable.patch

File 3744-0001-extfs-u7z-make-it-testable.patch, 1.3 KB (added by mooffie, 5 years ago)
  • src/vfs/extfs/helpers/u7z

    From 76cf69fa17fe615da2f768ef736f37403f89d0c8 Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Mon, 19 Dec 2016 02:56:39 +0200
    Subject: [PATCH 1/2] Ticket #3744: extfs: u7z: make it testable.
    
    ---
     src/vfs/extfs/helpers/u7z | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/src/vfs/extfs/helpers/u7z b/src/vfs/extfs/helpers/u7z
    index 5caa90f..04f3f9c 100755
    a b  
    1919 
    2020P7ZIP=`which 7z 2>/dev/null` || P7ZIP=`which 7za 2>/dev/null` || P7ZIP=`which 7zr 2>/dev/null` || P7ZIP="" 
    2121 
     22# Let the test framework hook in: 
     23P7ZIP=${MC_TEST_EXTFS_LIST_CMD:-$P7ZIP} 
     24STAT=${MC_TEST_EXTFS_U7Z_STAT:-stat} 
     25 
    2226mcu7zip_list () 
    2327{ 
    2428        # Symlinks are not shown - no idea how to distinguish them 
    mcu7zip_list () 
    3539        zero_size='           0' 
    3640 
    3741        # archive entries can have no datetime info, 7z will use archive file datetime 
    38         date_archive=`stat -c %y "$1" 2>/dev/null | sed -n "s/${date_re}.*/${date_mc}/p" 2>/dev/null` 
     42        date_archive=`$STAT -c %y "$1" 2>/dev/null | sed -n "s/${date_re}.*/${date_mc}/p" 2>/dev/null` 
    3943        [ "${date_archive}"x = x ] && date_archive=`ls -lan "$1" 2>/dev/null | awk '{print $6, $7, $8}' 2>/dev/null` 
    4044        [ "${date_archive}"x = x ] && date_archive="01-01-1970 00:00:00" 
    4145