3 # ISO9660 VFS for MC by Michael Shigorin <mike@altlinux.org>,
4 # modifications by Grigory Milev <week@altlinux.org>
5 # and Kachalov Anton <mouse@linux.ru.net> April 2003
6 # based on lslR by Tomas Novak <tnovak@ipex.cz> April 2000
7 # -- look there for additional parsing comments if needed
9 # tested to comply with isoinfo 2.0's output
12 CHARSET
=`locale charmap 2>/dev/null`
13 if test -z "$CHARSET"; then
14 CHARSET
=`locale 2>/dev/null | grep LC_CTYPE | sed -n -e 's/.*\.\(.*\)"$/\1/p'`
16 if test -n "$CHARSET"; then
17 CHARSET
=`echo "$CHARSET" | tr '[A-Z]' '[a-z]' | sed -e 's/^iso-/iso/'`
18 isoinfo
-j $CHARSET -i /dev
/null
2>&1 |
grep "Unknown charset" >/dev
/null
&& CHARSET
=
20 if test -n "$CHARSET"; then
21 JOLIET_OPT
="-j $CHARSET -J"
26 isoinfo
-d -i "$1" |
grep "NO Joliet" > /dev
/null || ISOINFO
="$ISOINFO $JOLIET_OPT"
30 # left as a reminder to implement compressed image support =)
32 *.lzma
) MYCAT
="lzma -dc";;
33 *.bz2
) MYCAT
="bzip2 -dc";;
34 *.gz
) MYCAT
="gzip -dc";;
35 *.z
) MYCAT
="gzip -dc";;
36 *.Z
) MYCAT
="gzip -dc";;
40 $ISOINFO -l -i "$1" | @AWK@
'
43 # Pattern to match 8 first fields.
45 rx = "^" rx rx rx rx rx rx rx rx;
46 irx = "^\\[ *[0-9]* *[0-9]+\\] ";
49 /^d---------/ { next }
50 /^Directory listing of [^ ].*$/ {
57 attr=substr($0, 1, length($0)-length(name))
58 # strip inodes and extra dir entries; fix perms
60 sub("^---------- 0 0 0", "-r--r--r-- 1 root root", attr)
62 ## sub(";[0-9]+$", "", name) ## would break copyout
64 if (name ~ /^\.\.?/) next;
65 printf "%s%s%s\n", attr, dir, name
70 $ISOINFO -i "$1" -x "/$2" > "$3"