Ticket #3122: xorriso iso9660 show only one depth

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2014-03-17 15:11:21 +03:00
parent dee4d1101e
commit 272116b0a8
1 changed files with 11 additions and 6 deletions

View File

@ -37,14 +37,19 @@ xorriso_list() {
if test -z "$XORRISO"; then
return 1
fi
local dir attr ln usr gr sz dt1 dt2 dt3 nm len name
dir="$2"
$XORRISO -dev stdio:"$1" -cd "$dir" -lsl 2> /dev/null | @GREP@ "^[-d]" | \
local dir attr ln usr gr sz dt1 dt2 dt3 nm len name lsl r
dir="${2:-/}"
lsl=$( $XORRISO -abort_on FATAL -dev stdio:"$1" -cd "$dir" -lsl 2> /dev/null )
r=$?
test $r -gt 0 && return $r
echo "$lsl" | @GREP@ "^[-d]" | \
while read attr ln usr gr sz dt1 dt2 dt3 nm ; do
len=$((${#nm} - 1))
name=$(printf "$nm" | cut -c2-$len) # remove quotes
if test $(printf "$nm" | cut -c1-2) != "d"; then
printf "%s %s %s %s %s %s %s %s %s/%s\n" "$attr" "$ln" "$usr" "$gr" "$sz" "$dt1" "$dt2" "$dt3" "$dir" "$name"
name=$(printf -- "$nm" | cut -c2-$len) # remove quotes
if test $(printf -- "$attr" | cut -c1-1) != "d"; then
printf -- "%s %s %s %s %s %s %s %s %s/%s\n" "$attr" "$ln" "$usr" "$gr" "$sz" "$dt1" "$dt2" "$dt3" "$dir" "$name"
else
xorriso_list "$1" "$dir/$name"
fi