3 # Written by andrey joukov
4 # (C) 1996 2:5020/337.13@fidonet.org
5 # Updated by christian.gennerat@alcatel.fr 1999
10 UNRAR=$DRAR/unrar # Prefer unrar (freeware)
12 # NOTE: rar ver 2.0 by Eugene Roshal
13 # ftp.elf.stuba.sk/pub/pc/pack
18 $UNRAR v -c- "$1" | @AWK@ -v uid=${UID-0} '
19 BEGIN { flag=0; date="JanFebMarAprMayJunJulAugSepOctNovDec" }
20 /^-------/ { flag++; if (flag > 1) exit 0; next }
23 if ( !/ [0-9][0-9]:[0-9][0-9] /) str = $0 # there is no time spec in this line
32 if (index($6, "D") != 0)
35 if (index($6, ".") != 0)
37 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
44 # copyin by christian.gennerat@alcatel.fr
45 # preserve pwd. It is clean, but is it necessary?
47 # Create a directory and copy in it the tmp file with the good name
51 # if file is to be written upper in the archive tree, make fake dir
52 if test "$di" != "${2##*/}" ; then
55 # (cp -p) to preserve date, but $2 is dated now!
57 $RAR a "$1" "$2" >/dev/null
64 $UNRAR p -c- -inul "$1" "$2" > $3 2>/dev/null
69 # preserve pwd. It is clean, but is it necessary?
71 # Create a directory and create in it a tmp directory with the good name
76 # rar cannot create an empty directory
78 $RAR a -r "$1" "$2" &>/dev/null
79 $RAR d "$1" "$2"/.rarfs &>/dev/null
86 $RAR d "$1" "$2" &>/dev/null
91 # uncomment this line for debugging
92 #echo "`date +%T` ${0##*/} $1 $2 to=$3 tmp=$4" >>/tmp/${0##*/}.log
94 list) mcrarfs_list "$2"; exit 0;;
95 rm) mcrarfs_rm "$2" "$3" ; exit 0;;
96 rmdir) mcrarfs_rm "$2" "$3" ; exit 0;;
97 mkdir) mcrarfs_mkdir "$2" "$3" ; exit 0;;
98 copyin) mcrarfs_copyin "$2" "$3" $4; exit 0;;
99 copyout) mcrarfs_copyout "$2" "$3" $4; exit 0;;