Ticket #2376: mc-extfs-uace.patch

File mc-extfs-uace.patch, 1.9 KB (added by eugenesan, 12 years ago)
  • /usr/lib/mc/extfs.d/uace

    old new  
    22 
    33# 
    44# ACE Virtual filesystem executive v0.1 
    5 # Works with unace v2.5 
    6  
    7 # Copyright (C) 2008 Jacques Pelletier 
     5# Works with unace-nonfree v2.5 
     6# 
     7# Copyright (C) 2008 Jacques Pelletier <jpelletier@ieee.org> 
     8# Copyright (C) 2010 Eugene San (eugenesan) <eugenesan@gmail.com 
    89# May be distributed under the terms of the GNU Public License 
    9 # <jpelletier@ieee.org> 
    1010# 
    1111 
    1212# Define your awk 
     
    1717# ACE_PUT="unace ?"  not available 
    1818 
    1919# The 'list' command executive 
    20  
    21 # Unace:        DD.MM.YY HH.MM packed size ratio file  
    22 # ls: 
     20# unace:        DD.MM.YY HH.MM packed size ratio filename 
     21# list:         -rw-r--r-- 1 uid gid size MM/DD/CCYY HH:MM filename 
    2322mc_ace_fs_list() 
    2423{ 
    25     $ACE_LIST "$1" | gawk -v uid=${UID-0} ' 
    26 BEGIN { Month="JanFebMarAprMayJunJulAugSepOctNovDec" } 
     24        $ACE_LIST "$1" | gawk -v uid=`id -u` -v gid=`id -g` ' 
     25BEGIN { } 
    2726/%/ {  
    2827  split($1,date,".") 
    2928 
     
    3231  else 
    3332    date[3]=date[3] + 2000 
    3433 
    35   printf "-rw-r--r--   1 %-8d %-8d %8d %s %2d %4d %s %s\n", uid, 0, $3, substr(Month,3*(date[2]-1)+1,3),date[1],date[3], $2, $6 
     34  printf "-rw-r--r-- 1 %s %s %d %02d/%02d/%04d %s %s\n", uid, gid, $4, date[2],date[1],date[3], $2, $6 
    3635}' 2>/dev/null 
    37     exit 0 
     36        exit 0 
    3837} 
    3938 
    4039# Command: copyout archivename storedfilename extractto 
    4140mc_ace_fs_copyout() 
    4241{ 
    43    $ACE_GET "$1" "$2" > /dev/null 2>&1 
    44         mv "$2" "$3" 
     42        opwd="$(pwd)" && \ 
     43        cd "$(dirname "${3}")" && \ 
     44        rm -f ${2} ${3} && \ 
     45        $ACE_GET "$1" "$2" > /dev/null 2>&1 && \ 
     46        mv "$2" "$3" && \ 
     47        cd ${opwd} && \ 
     48        exit 0 
    4549} 
    4650 
    4751# The main routine 
     
    5155shift 
    5256 
    5357case "$cmd" in 
    54    list)        mc_ace_fs_list    "$@" ;; 
    55    copyout) mc_ace_fs_copyout "$@" ;; 
    56    *)       exit 1 ;; 
     58        list)           mc_ace_fs_list    "$@" ;; 
     59        copyout)        echo $(pwd) $@ > /tmp/uace.log; mc_ace_fs_copyout "$@" ;; 
     60        *)              exit 1 ;; 
    5761esac 
    5862exit 0