* extfs/iso9660.in: New filesystem for ISO-9660 images.

From Michael Shigorin <mike@altlinux.org>
* extfs/extfs.ini: Add iso9660.
* extfs/Makefile.am: Add extfs/iso9660.in.
This commit is contained in:
Pavel Roskin 2003-04-29 16:03:11 +00:00
parent 20108fc69a
commit f9fd075f21
4 changed files with 84 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2003-04-29 Pavel Roskin <proski@gnu.org>
* extfs/iso9660.in: New filesystem for ISO-9660 images.
From Michael Shigorin <mike@altlinux.org>
* extfs/extfs.ini: Add iso9660.
* extfs/Makefile.am: Add extfs/iso9660.in.
2003-04-03 Andrew V. Samoilov <sav@bcs.zp.ua> 2003-04-03 Andrew V. Samoilov <sav@bcs.zp.ua>
* smbfs.c (open_readwrite): New function to replace open_read() * smbfs.c (open_readwrite): New function to replace open_read()

View File

@ -15,6 +15,7 @@ EXTFS_IN = \
deba.in \ deba.in \
debd.in \ debd.in \
dpkg.in \ dpkg.in \
iso9660.in \
hp48.in \ hp48.in \
lslR.in \ lslR.in \
mailfs.in \ mailfs.in \
@ -37,6 +38,7 @@ EXTFS_OUT = \
deba \ deba \
debd \ debd \
dpkg \ dpkg \
iso9660 \
hp48 \ hp48 \
lslR \ lslR \
mailfs \ mailfs \

View File

@ -49,3 +49,6 @@ audio
# Package of Bad Penguin (an Italian GNU/Linux distribution) # Package of Bad Penguin (an Italian GNU/Linux distribution)
bpp bpp
# ISO image
iso9660

72
vfs/extfs/iso9660.in Normal file
View File

@ -0,0 +1,72 @@
#! /bin/sh
# ISO9660 VFS for MC by Michael Shigorin <mike@altlinux.org> April 2003
# based on lslR by Tomas Novak <tnovak@ipex.cz> April 2000
# -- look there for additional parsing comments if needed
# tested to comply with isoinfo 2.0's output
test_iso () {
for i in '-J -R' '-J' '-R'; do
ISOINFO="isoinfo $i"
$ISOINFO "$1" >/dev/null 2>&1 && break
done
}
mcisofs_list () {
case "$1" in
*.bz2) MYCAT="bzip2 -dc";;
*.gz) MYCAT="gzip -dc";;
*.z) MYCAT="gzip -dc";;
*.Z) MYCAT="gzip -dc";;
*) MYCAT="cat";;
esac
$ISOINFO -l -i "$1" | @AWK@ '
BEGIN {
dir="";
# Pattern to match 8 first fields.
rx = "[^ ]+[ ]+";
rx = "^" rx rx rx rx rx rx rx rx;
irx = "^. *[0-9]+. ";
}
/^$/ { next }
/^d---------/ { next }
/^Directory listing of [^ ].*$/ {
dir=substr($0, 23);
next;
}
{ $11 != "" } {
name=$0
sub(rx, "", name)
attr=substr($0, 1, length($0)-length(name))
# strip inodes and extra dir entries; fix perms
sub(irx, "", name)
sub("^---------- 0 0 0", "-r--r--r-- 1 root root", attr)
sub(" $", "", name)
# skip . and ..
if (name ~ /^\.\.?/) next;
printf "%s%s%s\n", attr, dir, name
}'
}
mcisofs_copyout () {
$ISOINFO -i "$1" -x "/$2" > "$3"
}
export LC_ALL="C"
cmd="$1"
shift
case "$cmd" in
list)
test_iso "$@";
mcisofs_list "$@";
exit 0;;
copyout)
test_iso "$@";
mcisofs_copyout "$@";
exit 0;;
esac
exit 1