Ticket #1681: mc-4.7.0-alt-extfs-ucab.patch

File mc-4.7.0-alt-extfs-ucab.patch, 2.0 KB (added by wRAR, 15 years ago)
  • misc/mc.ext.in

    diff --git a/misc/mc.ext.in b/misc/mc.ext.in
    index 493e8c5..bb5b4b7 100644
    a b regex/\.a(rj|[0-9][0-9])$ 
    154154        Open=%cd %p#uarj 
    155155        View=%view{ascii} unarj l %f 
    156156 
     157# cab 
     158regex/\.([cC][aA][bB])$ 
     159        Open=%cd %p#ucab 
     160        View=%view{ascii} cabextract -l %f 
     161 
    157162# ha 
    158163regex/\.([Hh][Aa])$ 
    159164        Open=%cd %p#uha 
  • vfs/extfs/Makefile.am

    diff --git a/vfs/extfs/Makefile.am b/vfs/extfs/Makefile.am
    index 48253f3..4d10507 100644
    a b EXTFSCONFFILES = extfs.ini sfs.ini 
    66EXTFS_MISC  = README 
    77 
    88# Scripts hat don't need adaptation to the local system 
    9 EXTFS_CONST = bpp rpm trpm srpm u7z 
     9EXTFS_CONST = bpp rpm trpm srpm u7z ucab 
    1010 
    1111# Scripts that need adaptation to the local system - source files 
    1212EXTFS_IN    =                   \ 
    EXTFS_OUT = \ 
    6262        uzip                    \ 
    6363        uzoo 
    6464 
     65 
    6566if USE_VFS 
    6667extfs_DATA = $(EXTFS_MISC) 
    6768extfs_SCRIPTS = $(EXTFS_CONST) $(EXTFS_OUT) 
  • vfs/extfs/extfs.ini

    diff --git a/vfs/extfs/extfs.ini b/vfs/extfs/extfs.ini
    index bfc6e91..47dc69b 100644
    a b uarj 
    1414uarc 
    1515uace 
    1616 
     17# For cab files 
     18ucab 
     19 
    1720# ar is used for static libraries 
    1821uar 
    1922 
  • new file vfs/extfs/ucab

    diff --git a/vfs/extfs/ucab b/vfs/extfs/ucab
    new file mode 100644
    index 0000000..e6bded3
    - +  
     1#! /bin/sh 
     2 
     3CAB=cabextract 
     4 
     5mccabfs_list () 
     6{ 
     7    $CAB -l "$1" | gawk -v uid=`id -un` -v gid=`id -gn` ' 
     8BEGIN { flag=0 } 
     9/^-------/ { flag++; if (flag > 1) exit 0; next } 
     10{ 
     11if (flag == 0) next 
     12if (length($6) == 0) next 
     13pr="-rw-r--r--" 
     14split($3, a, ".") 
     15split($4, b, ":") 
     16printf "%s 1 %s %s %d %02d/%02d/%02d %02d:%02d  %s\n", pr, uid, gid, $1, a[2], a[1], a[3], b[1], b[2], $6 
     17}' 
     18 
     19} 
     20 
     21mccabfs_copyout () 
     22{ 
     23    $CAB -F "$2" -p "$1" > "$3" 
     24} 
     25 
     26LC_ALL=C 
     27export LC_ALL 
     28 
     29umask 077 
     30 
     31cmd="$1" 
     32 
     33case "$cmd" in 
     34  # Workaround for a bug in mc - directories must precede files to 
     35  # avoid duplicate entries, so we sort output by filenames 
     36  list)    mccabfs_list    "$2" ;; 
     37  copyout) mccabfs_copyout "$2" "$3" "$4" ;; 
     38  *) exit 1 ;; 
     39esac 
     40exit 0