3 # Written by andrey joukov
4 # (C) 1996 2:5020/337.13@fidonet.org
5 # Updated by christian.gennerat@alcatel.fr 1999
6 # Andrew V. Samoilov <sav@bcs.zp.ua> 2000
11 UNRAR
=$DRAR/unrar
# Prefer unrar (freeware)
13 # NOTE: rar ver 2.0 by Eugene Roshal
14 # ftp.elf.stuba.sk/pub/pc/pack
17 if [ ! -x $UNRAR -a -x $RAR ]; then
23 $UNRAR v
-c- "$1" | @AWK@
-v uid
=${UID-0} '
24 BEGIN { flag=0; date="JanFebMarAprMayJunJulAugSepOctNovDec" }
25 /^-------/ { flag++; if (flag > 1) exit 0; next }
28 if ( !/ [0-9][0-9]:[0-9][0-9] /) str = $0 # there is no time spec in this line
37 if (index($6, "D") != 0)
40 if (index($6, ".") != 0)
42 printf "%s 1 %-8d %-8d %8d %3s %2d %4d %s %s\n", $6, uid, 0, $1, substr(date, (a[2]-1)*3+1, 3), a[1], a[3], $5, str
49 # copyin by christian.gennerat@alcatel.fr
50 # preserve pwd. It is clean, but is it necessary?
52 # Create a directory and copy in it the tmp file with the good name
56 # if file is to be written upper in the archive tree, make fake dir
57 if test "$di" != "${2##*/}" ; then
60 # (cp -p) to preserve date, but $2 is dated now!
62 $RAR a
"$1" "$2" >/dev
/null
69 $UNRAR p
-c- -inul "$1" "$2" > $3 2>/dev
/null
74 # preserve pwd. It is clean, but is it necessary?
76 # Create a directory and create in it a tmp directory with the good name
81 # rar cannot create an empty directory
83 $RAR a
-r "$1" "$2" &>/dev
/null
84 $RAR d
"$1" "$2"/.rarfs
&>/dev
/null
91 $RAR d
"$1" "$2" &>/dev
/null
96 # uncomment this line for debugging
97 #echo "`date +%T` ${0##*/} $1 $2 to=$3 tmp=$4" >>/tmp/${0##*/}.log
99 list
) mcrarfs_list
"$2" |
sort +9 ; exit 0;;
100 rm) mcrarfs_rm
"$2" "$3" ; exit 0;;
101 rmdir) mcrarfs_rm
"$2" "$3" ; exit 0;;
102 mkdir
) mcrarfs_mkdir
"$2" "$3" ; exit 0;;
103 copyin
) mcrarfs_copyin
"$2" "$3" $4; exit 0;;
104 copyout
) mcrarfs_copyout
"$2" "$3" $4; exit 0;;