@@ -13,11 +13,54 @@ do_view_action() {
13
13
14
14
case " ${filetype} " in
15
15
iso9660)
16
- if which isoinfo > /dev/null 2>&1 ; then
17
- isoinfo -d -i " ${MC_EXT_FILENAME} " && isoinfo -l -R -J -i " ${MC_EXT_FILENAME} "
18
- else
19
- 7za l " ${MC_EXT_FILENAME} "
20
- fi
16
+ if which isoinfo > /dev/null 2>&1 ; then
17
+ info=$( isoinfo -d -i " ${MC_EXT_FILENAME} " )
18
+ _st=$?
19
+
20
+ if [ " $_st " = 0 ]; then
21
+ # Prepend the listing with `isoinfo -d` output
22
+ echo " $info "
23
+
24
+ echo " $info " | {
25
+ rock=n
26
+ joliet=n
27
+
28
+ while read -r line; do
29
+ case " $line " in
30
+ Rock* found)
31
+ rock=y ;;
32
+ Joliet* found)
33
+ joliet=y ;;
34
+ esac
35
+ done
36
+
37
+ # Contrary to xorriso, isoinfo does not assume the "natural"
38
+ # Rock Ridge -> Joliet -> ECMA-119 fallback order. Without
39
+ # any options it uses ECMA-119. With -R it uses Rock Ridge,
40
+ # if present, with a fallback to ECMA-119. With -J it uses
41
+ # Joliet, if present, but throws an error otherwise. When
42
+ # both -J and -R are set (regardless the order), -R is
43
+ # ignored. Hence, there is no point in using both together
44
+ # in the sense of "either of the two".
45
+
46
+ ext=
47
+ if [ $rock = y ]; then
48
+ ext=-R
49
+ elif [ $joliet = y ]; then
50
+ ext=-J
51
+ fi
52
+
53
+ # `isoinfo -l` should be the last command to transfer its
54
+ # status to the pipe
55
+ isoinfo -l $ext -i " ${MC_EXT_FILENAME} "
56
+ } || _st=$?
57
+ fi
58
+
59
+ # Set status as if it was `isoinfo -d .. && isoinfo -l ..` one-liner
60
+ (exit " $_st " )
61
+ else
62
+ 7za l " ${MC_EXT_FILENAME} "
63
+ fi
21
64
;;
22
65
cat)
23
66
cat " ${MC_EXT_FILENAME} " 2> /dev/null
0 commit comments