* extfs/ualz.in: New file - support for ALZip archives.

* extfs/Makefile.am: Add ualz.
* extfs/extfs.ini: Likewise.
This commit is contained in:
Pavel Roskin 2005-07-20 19:03:53 +00:00
parent 43eab2720a
commit a24baacdf8
5 changed files with 71 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2005-07-20 Pavel Roskin <proski@gnu.org>
* extfs/ualz.in: New file - support for ALZip archives.
* extfs/Makefile.am: Add ualz.
* extfs/extfs.ini: Likewise.
2005-07-06 Pavel Tsekov <ptsekov@gmx.net>
* tar.c (tar_read_header): Properly handle non \0 terminated tar

View File

@ -13,6 +13,7 @@ lslR
mailfs
patchfs
rpms
ualz
uar
uarj
uha

View File

@ -21,6 +21,7 @@ EXTFS_IN = \
mailfs.in \
patchfs.in \
rpms.in \
ualz.in \
uar.in \
uarj.in \
uha.in \
@ -44,6 +45,7 @@ EXTFS_OUT = \
mailfs \
patchfs \
rpms \
ualz \
uar \
uarj \
uha \

View File

@ -8,6 +8,7 @@ ulha
urar
uha
u7z
ualz
# For arj usage you need a special patch to unarj (see unarj.diff)
uarj

61
vfs/extfs/ualz.in Normal file
View File

@ -0,0 +1,61 @@
#!/bin/sh
#
# Written by Pavel Roskin <proski@gnu.org>
# (C) 2005 The Free Software Foundation.
#
#
UNALZ=unalz
mcualz_list ()
{
$UNALZ -l "$1" | @AWK@ -v uid=`id -nu` -v gid=`id -ng` '
{
if ($0 ~ /^[0-9][0-9][0-9][0-9]:[0-9][0-9]:[0-9][0-9] /)
{
split($1, date, ":")
time=$2
perm=$3
size=$4
sub(/^[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* */, "")
file=$0
gsub(/\\/, "/", file)
if (perm ~ /.D../)
perm = "drwxr-xr-x"
else
perm = "-rw-r--r--"
printf "%s 1 %s %s %d %02d-%02d-%02d %s %s\n", perm, uid, gid, size, date[2], date[3], date[1], time, file
}
}
'
}
mcualz_copyout ()
{
TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-ualz.XXXXXX` || exit 1
# This is a workaround for a bug in unalz 0.50 - it crashes if the
# output directory is an absolute path.
dir=`dirname "$TMPDIR/$2"`
mkdir -p "$dir"
$UNALZ -d "$TMPDIR" "$1" "$2" >/dev/null
cat "$TMPDIR/$2" > "$3"
rm -rf "$TMPDIR"
}
# override any locale for dates
LC_ALL=C
export LC_ALL
umask 077
cmd="$1"
shift
case "$cmd" in
list) mcualz_list "$@" ;;
copyout) mcualz_copyout "$@" ;;
*) exit 1 ;;
esac
exit 0