From ec98ac4cf7b9a6d805d82739df0c0d5e3c8043df Mon Sep 17 00:00:00 2001 From: Pavel Tsekov Date: Wed, 19 Jul 2006 11:19:52 +0000 Subject: [PATCH] * vfs/extfs/iso9660.in (test_iso): Use `locale charmap' to retrieve the current character set. If that fails fallback to using the LC_CTYPE field of `locale' output. When invoking `isoinfo' to test whether it supports a given character set tell it to use /dev/null as the cdrom device so that it will bail out immediatly instead of accessing a real drive. --- vfs/ChangeLog | 9 +++++++++ vfs/extfs/iso9660.in | 9 ++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index c51efadf2..d45dd6b19 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,12 @@ +2006-07-19 Egmont Koblinger + + * extfs/iso9660.in (test_iso): Use `locale charmap' to retrieve + the current character set. If that fails fallback to using + the LC_CTYPE field of `locale' output. + When invoking `isoinfo' to test whether it supports a given character + set tell it to use /dev/null as the cdrom device so that it will bail + out immediatly instead of accessing a real drive. + 2006-07-18 Egmont Koblinger * extfs/deb.in (mcdebfs_list): Do not skip over directory entries. diff --git a/vfs/extfs/iso9660.in b/vfs/extfs/iso9660.in index 9665b1e21..91d1b1ed7 100644 --- a/vfs/extfs/iso9660.in +++ b/vfs/extfs/iso9660.in @@ -9,9 +9,13 @@ # tested to comply with isoinfo 2.0's output test_iso () { - CHARSET=`echo "$save_ctype" | sed -n -e 's/.*\.\(.*\)"$/\1/p' | tr '[A-Z]' '[a-z]'` + CHARSET=`locale charmap 2>/dev/null` + if test -z "$CHARSET"; then + CHARSET=`locale 2>/dev/null | grep LC_CTYPE | sed -n -e 's/.*\.\(.*\)"$/\1/p'` + fi if test -n "$CHARSET"; then - isoinfo -j $CHARSET 2>&1 | grep "Unknown charset" >/dev/null && CHARSET= + CHARSET=`echo "$CHARSET" | tr '[A-Z]' '[a-z]' | sed -e 's/^iso-/iso/'` + isoinfo -j $CHARSET -i /dev/null 2>&1 | grep "Unknown charset" >/dev/null && CHARSET= fi if test -n "$CHARSET"; then JOLIET_OPT="-j $CHARSET -J" @@ -65,7 +69,6 @@ mcisofs_copyout () { $ISOINFO -i "$1" -x "/$2" > "$3" } -save_ctype=`locale 2>/dev/null | grep LC_CTYPE` LC_ALL=C cmd="$1"