1
1

* extfs/urar.in: Remove month translation and year windowing -

they are better handled by mc.  Use more robust date format.
Set locale to C.
Этот коммит содержится в:
Pavel Roskin 2005-07-25 21:51:51 +00:00
родитель 271a56e3f8
Коммит 3b40737834
2 изменённых файлов: 13 добавлений и 10 удалений

Просмотреть файл

@ -1,5 +1,9 @@
2005-07-25 Pavel Roskin <proski@gnu.org>
* extfs/urar.in: Remove month translation and year windowing -
they are better handled by mc. Use more robust date format.
Set locale to C.
* extfs/uzip.in: Preserve seconds. Avoid month translation - it
only slows down processing.

Просмотреть файл

@ -24,8 +24,8 @@ done
mcrarfs_list ()
{
$UNRAR v -c- "$1" | @AWK@ -v uid=${UID-0} '
BEGIN { flag=0; date="JanFebMarAprMayJunJulAugSepOctNovDec" }
$UNRAR v -c- "$1" | @AWK@ -v uid=`id -u` -v gid=`id -g` '
BEGIN { flag=0 }
/^-------/ { flag++; if (flag > 1) exit 0; next }
{
if (flag == 0) next
@ -34,16 +34,12 @@ else {
if (str ~ /^\^/)
str=substr(str, 2)
split($4, a, "-")
if (a[3] < 50)
a[3] = 2000 + a[3]
else
a[3] = 1900 + a[3]
if (index($6, "D") != 0)
$6="drwxr-xr-x"
else
if (index($6, ".") != 0)
$6="-rw-r--r--"
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
printf "%s 1 %s %s %d %02d/%02d/%02d %s %s\n", $6, uid, gid, $1, a[2], a[1], a[3], $5, str
}
}'
}
@ -93,15 +89,18 @@ mcrarfs_rm ()
$RAR d "$1" "$2" >/dev/null
}
LC_ALL=C
export LC_ALL
umask 077
cmd="$1"
shift
case "$cmd" in
list) mcrarfs_list "$@" | sort -k 10 ;; # rar lists directories
# after files, so sort names
# to prevent duplication
# Workaround for a bug in mc - directories must precede files to
# avoid duplicate entries, so we sort output by filenames
list) mcrarfs_list "$@" | sort -k 8 ;;
rm) mcrarfs_rm "$@" ;;
rmdir) mcrarfs_rm "$@" ;;
mkdir) mcrarfs_mkdir "$@" ;;