1998-02-27 07:54:42 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Written by Alex Kuchma <ask@bcs.zp.ua>
|
|
|
|
# Alex Tkachenko <alex@bcs.zp.ua>
|
1998-06-03 18:08:47 +04:00
|
|
|
# Updated by Vitezslav Samel <xsamel00@dcse.fee.vutbr.cz>
|
1998-02-27 07:54:42 +03:00
|
|
|
#
|
1998-06-03 18:08:47 +04:00
|
|
|
# (C) 1997, 1998 The Free Software Foundation.
|
1998-02-27 07:54:42 +03:00
|
|
|
#
|
|
|
|
#
|
|
|
|
XAR=ar
|
|
|
|
XUNAR=ar
|
|
|
|
XARINFO="ar tv"
|
1998-06-03 18:08:47 +04:00
|
|
|
AWK=awk
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
mcarfs_list ()
|
|
|
|
{
|
1998-06-03 18:08:47 +04:00
|
|
|
YEAR=`date '+%Y'`
|
|
|
|
$XARINFO $1 | @AWK@ -v year=$YEAR '
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
date = $(NF-1)
|
1998-06-03 18:08:47 +04:00
|
|
|
if(date == year) {
|
|
|
|
date = $(NF-2);
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
1998-06-03 18:08:47 +04:00
|
|
|
perms = substr($1, 1, 9);
|
|
|
|
split($2, id, "/");
|
|
|
|
if(NF > 8) {
|
|
|
|
id[2] = $3;
|
|
|
|
}
|
|
|
|
printf("-%9s 1 %8d %8d %8d %s %s %s %s\n", perms, id[1], id[2], $(NF-5), $(NF-4), $(NF-3), date, $(NF));
|
1998-02-27 07:54:42 +03:00
|
|
|
}' 2>/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
mcarfs_copyout ()
|
|
|
|
{
|
|
|
|
$XUNAR p $1 $2 > $3
|
|
|
|
}
|
|
|
|
|
|
|
|
# override any locale for dates
|
|
|
|
LC_ALL=C
|
|
|
|
export LC_ALL
|
|
|
|
|
1998-12-16 09:16:13 +03:00
|
|
|
umask 077
|
1998-02-27 07:54:42 +03:00
|
|
|
case "$1" in
|
|
|
|
list) mcarfs_list $2; exit 0;;
|
|
|
|
copyout) shift; mcarfs_copyout $*; exit 0;;
|
|
|
|
copyin) shift; mcarfs_copyin $*; exit 0;;
|
|
|
|
esac
|
|
|
|
exit 1
|