From 3293c5b2374f34a0013b766214fd91284996e1ea Mon Sep 17 00:00:00 2001 From: Sergey Date: Fri, 4 Feb 2011 10:47:26 +0300 Subject: [PATCH] Ticket #2471: isoinfo adds ";1" to the end of file name when Joliet w/o Rock Ridge is used. Signed-off-by: Andrew Borodin --- lib/vfs/mc-vfs/extfs/iso9660.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/vfs/mc-vfs/extfs/iso9660.in b/lib/vfs/mc-vfs/extfs/iso9660.in index 2522cba23..964c4f8a3 100644 --- a/lib/vfs/mc-vfs/extfs/iso9660.in +++ b/lib/vfs/mc-vfs/extfs/iso9660.in @@ -24,6 +24,12 @@ test_iso () { fi ISOINFO="isoinfo -R" isoinfo -d -i "$1" 2>/dev/null | @GREP@ "UCS level 1\|NO Joliet" > /dev/null || ISOINFO="$ISOINFO $JOLIET_OPT" + + if [ `isoinfo -d -i "$1" 2>/dev/null | @GREP@ "Joliet with UCS level 3 found" | wc -l` == 1 ] ; then + if [ `isoinfo -d -i "$1" 2>/dev/null | @GREP@ "NO Rock Ridge" | wc -l` == 1 ] ; then + SEMICOLON="YES" + fi + fi } mcisofs_list () { @@ -38,7 +44,7 @@ case "$1" in *) MYCAT="cat";; esac -$ISOINFO -l -i "$1" | @AWK@ ' +$ISOINFO -l -i "$1" 2>/dev/null | @AWK@ -v SEMICOLON=$SEMICOLON ' BEGIN { dir=""; # Pattern to match 8 first fields. @@ -60,6 +66,8 @@ BEGIN { sub(irx, "", name) sub("^---------- 0 0 0", "-r--r--r-- 1 root root", attr) sub(" $", "", name) + # for Joliet UCS level 3 + if (SEMICOLON = "YES") sub(";1$", "", name); ## sub(";[0-9]+$", "", name) ## would break copyout # skip . and .. if (name ~ /^\.\.?/) next; @@ -68,7 +76,11 @@ BEGIN { } mcisofs_copyout () { - $ISOINFO -i "$1" -x "/$2" > "$3" + if [ "x$SEMICOLON" == "xYES" ]; then + $ISOINFO -i "$1" -x "/$2;1" 2>/dev/null > "$3" + else + $ISOINFO -i "$1" -x "/$2" 2>/dev/null > "$3" + fi } LC_ALL=C