Merge branch '3122_xorriso_one_depth'

* 3122_xorriso_one_depth:
  Ticket #3122: xorriso iso9660 show only one depth
This commit is contained in:
Slava Zanko 2014-03-19 12:05:09 +03:00
commit 8ee4732bd5
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