Ticket #2471: isoinfo adds ";1" to the end of file name when Joliet w/o Rock Ridge is used.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Sergey 2011-02-04 10:47:26 +03:00 committed by Andrew Borodin
parent f11a7290cc
commit 3293c5b237

View File

@ -24,6 +24,12 @@ test_iso () {
fi fi
ISOINFO="isoinfo -R" ISOINFO="isoinfo -R"
isoinfo -d -i "$1" 2>/dev/null | @GREP@ "UCS level 1\|NO Joliet" > /dev/null || ISOINFO="$ISOINFO $JOLIET_OPT" 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 () { mcisofs_list () {
@ -38,7 +44,7 @@ case "$1" in
*) MYCAT="cat";; *) MYCAT="cat";;
esac esac
$ISOINFO -l -i "$1" | @AWK@ ' $ISOINFO -l -i "$1" 2>/dev/null | @AWK@ -v SEMICOLON=$SEMICOLON '
BEGIN { BEGIN {
dir=""; dir="";
# Pattern to match 8 first fields. # Pattern to match 8 first fields.
@ -60,6 +66,8 @@ BEGIN {
sub(irx, "", name) sub(irx, "", name)
sub("^---------- 0 0 0", "-r--r--r-- 1 root root", attr) sub("^---------- 0 0 0", "-r--r--r-- 1 root root", attr)
sub(" $", "", name) sub(" $", "", name)
# for Joliet UCS level 3
if (SEMICOLON = "YES") sub(";1$", "", name);
## sub(";[0-9]+$", "", name) ## would break copyout ## sub(";[0-9]+$", "", name) ## would break copyout
# skip . and .. # skip . and ..
if (name ~ /^\.\.?/) next; if (name ~ /^\.\.?/) next;
@ -68,7 +76,11 @@ BEGIN {
} }
mcisofs_copyout () { 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 LC_ALL=C