Skip to content

Commit

Permalink
unziptar: more better debugging when extraction fails
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Sep 1, 2023
1 parent f55bfcb commit 255f868
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions commands/unziptar
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ function unziptar() (
echo-error 'No extracted files matched the filter:'
echo-style --bold='Archive:' ' ' "$(file "$archive")"
echo-style --bold='Filter:' ' ' "$filter"
echo-style --bold='File:' ' ' "$file"
echo-style --bold='-- expanded paths --'
expand-path "$archive_directory/$filter"
echo-style --bold='-- filtered paths --'
echo-verbose "${filtered_paths[@]}"
echo-style --bold='-- ls --'
ls -la "$archive_directory"
} >/dev/stderr
return 1
Expand All @@ -221,12 +227,16 @@ function unziptar() (
# was only one intended?
if test -n "$file"; then
{
echo-error '<file> was not possible, multiple files would have been relocated:'
echo-error 'Too many extracted files matched the filter:'
echo-style --bold='Archive:' ' ' "$(file "$archive")"
echo-style --bold='Filter:' ' ' "$filter"
echo-style --bold='File:' ' ' "$file"
echo-style --bold='-- expanded paths --'
expand-path "$archive_directory/$filter"
echo-style --bold='-- filtered paths --'
echo-verbose "${filtered_paths[@]}"
print_line "directory=[$directory]"
print_line "file=[$file]"
print_line "filepath=[$filepath]"
print_line "archive=[$archive]"
echo-style --bold='-- ls --'
ls -la "$archive_directory"
} >/dev/stderr
return 1
fi
Expand Down

0 comments on commit 255f868

Please sign in to comment.