Produce good error messages for bad tarballs

This commit is contained in:
Max Howell 2012-08-22 09:33:10 -04:00
parent d423519766
commit 05991dd846

View File

@ -189,8 +189,12 @@ class Pathname
when /^\xFD7zXZ\x00/ then :xz
when /^Rar!/ then :rar
else
# Assume it is not an archive
nil
# This code so that bad-tarballs and zips produce good error messages
# when they don't unarchive properly.
case extname
when ".tar.gz", ".tgz", ".tar.bz2", ".tbz" then :tar
when ".zip" then :zip
end
end
end