From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 From: Sergey Organization: Home To: ALT Linux Sisyphus discussions Date: Sun, 19 Dec 2010 14:47:35 +0300 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_XDfDN/CSWPWSJrH" Message-Id: <201012191447.35842.a_s_y@sama.ru> Subject: [sisyphus] =?koi8-r?b?bWMgySAiOzEiINcgy8/Ow8Ugyc2jziDGwcrMz9c=?= X-BeenThere: sisyphus@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Sisyphus discussions List-Id: ALT Linux Sisyphus discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2010 11:47:51 -0000 Archived-At: List-Archive: List-Post: --Boundary-00=_XDfDN/CSWPWSJrH Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 8bit Content-Disposition: inline Приветствую. Пробую пофиксить https://bugzilla.altlinux.org/12299 . Пока родилось то, что в аттаче, но надо бы проверить, хотябы на отсутствие регрессий. У меня не слишком много разных iso в наличии. -- С уважением, Сергей a_s_y@sama.ru --Boundary-00=_XDfDN/CSWPWSJrH Content-Type: application/x-shellscript; name="iso9660" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iso9660" #! /bin/sh # ISO9660 VFS for MC by Michael Shigorin , # modifications by Grigory Milev # and Kachalov Anton April 2003 # based on lslR by Tomas Novak April 2000 # -- look there for additional parsing comments if needed # tested to comply with isoinfo 2.0's output test_iso () { 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 CHARSET=`echo "$CHARSET" | tr '[A-Z]' '[a-z]' | sed -e 's/^iso-/iso/'` isoinfo -j $CHARSET -i /dev/null 2>&1 | /bin/grep "Iconv not yet supported\|Unknown charset" >/dev/null && CHARSET= fi if test -n "$CHARSET"; then JOLIET_OPT="-j $CHARSET -J" else JOLIET_OPT="-J" fi ISOINFO="isoinfo -R" isoinfo -d -i "$1" 2>/dev/null | /bin/grep "UCS level 1\|NO Joliet" > /dev/null || ISOINFO="$ISOINFO $JOLIET_OPT" if [ `isoinfo -d -i "$1" 2>/dev/null | /bin/grep "Joliet with UCS level 3 found" | wc -l` == 1 ] ; then if [ `isoinfo -d -i "$1" 2>/dev/null | /bin/grep "NO Rock Ridge" | wc -l` == 1 ] ; then SEMICOLON="YES" fi fi } mcisofs_list () { # left as a reminder to implement compressed image support =) case "$1" in *.lzma) MYCAT="lzma -dc";; *.xz) MYCAT="xz -dc";; *.bz2) MYCAT="bzip2 -dc";; *.gz) MYCAT="gzip -dc";; *.z) MYCAT="gzip -dc";; *.Z) MYCAT="gzip -dc";; *) MYCAT="cat";; esac $ISOINFO -l -i "$1" 2>/dev/null | gawk -v SEMICOLON=$SEMICOLON ' BEGIN { dir=""; # Pattern to match 8 first fields. rx = "[^ ]+[ ]+"; rx = "^" rx rx rx rx rx rx rx rx; irx = "^\\[ *-?[0-9]* *[0-9]+\\] +"; } /^$/ { next } /^d---------/ { next } /^Directory listing of [^ ].*$/ { dir=substr($0, 23); next; } { $11 != "" } { name=$0 sub(rx, "", name) attr=substr($0, 1, length($0)-length(name)) # strip inodes and extra dir entries; fix perms 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; printf "%s%s%s\n", attr, dir, name }' } mcisofs_copyout () { 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 cmd="$1" shift case "$cmd" in list) test_iso "$@"; mcisofs_list "$@"; exit 0;; copyout) test_iso "$@"; mcisofs_copyout "$@"; exit 0;; esac exit 1 --Boundary-00=_XDfDN/CSWPWSJrH--