Ticket #2376: mc-extfs-uarc_v2.patch
File mc-extfs-uarc_v2.patch, 1.8 KB (added by eugenesan, 14 years ago) |
---|
-
/usr/lib/mc/extfs.d/uarc
old new 2 2 3 3 # 4 4 # ARC Virtual filesystem executive 5 # Copyright (C) 2008 Jacques Pelletier 5 # Copyright (C) 2008 Jacques Pelletier <jpelletier@ieee.org> 6 # Copyright (C) 2010 Eugene San (eugenesan) <eugenesan@gmail.com> 6 7 # May be distributed under the terms of the GNU Public License 7 # <jpelletier@ieee.org>8 8 # 9 9 10 10 # Define your awk … … 16 16 ARC_DEL="arc d" 17 17 18 18 # The 'list' command executive 19 19 # unarc: DD.MM.YY HH.MM packed size ratio filename 20 # list: -rw-r--r-- 1 uid gid size MMM/DD/CCYY HH:MM filename 20 21 mc_arc_fs_list() 21 22 { 22 $ARC_LIST "$1" | gawk -v uid=${UID-0}'23 $ARC_LIST "$1" | gawk -v uid=`id -u` -v gid=`id -g` ' 23 24 BEGIN { } 24 25 /^Name/ { next } 25 26 /===/ { next } … … 40 41 41 42 a[2]=substr(a[2],1,2) 42 43 } 43 44 printf "-rw-r--r-- 1 %-8d %-8d %8d %s %2d %4d %02d:%02d %s\n", uid, 0, $2, $7, $6, $8, a[1], a[2], $1 44 printf "-rw-r--r-- 1 %s %s %d %s/%2d/%4d %02d:%02d %s\n", uid, gid, $2, $7, $6, $8, a[1], a[2], $1 45 45 }' 2>/dev/null 46 46 exit 0 47 47 } 48 48 49 49 # Command: copyout archivename storedfilename extractto 50 50 mc_arc_fs_copyout() 51 51 { 52 $ARC_GET "$1" "$2" 2> /dev/null 53 mv "$2" "$3" 52 cd "$(dirname "${3}")" && \ 53 rm -f ${2} ${3} && \ 54 $ARC_GET "$1" "$2" > /dev/null 2>&1 && \ 55 mv "$2" "$3" && \ 56 exit 0 54 57 } 55 58 56 59 # Command: copyin archivename storedfilename sourcefile … … 73 76 shift 74 77 75 78 case "$cmd" in 76 list)mc_arc_fs_list "$@" ;;77 copyout)mc_arc_fs_copyout "$@" ;;78 copyin)mc_arc_fs_copyin "$@" ;;79 80 *)exit 1 ;;79 list) mc_arc_fs_list "$@" ;; 80 copyout) mc_arc_fs_copyout "$@" ;; 81 copyin) mc_arc_fs_copyin "$@" ;; 82 rm) mc_arc_fs_rm "$@" ;; 83 *) exit 1 ;; 81 84 esac 82 85 exit 0