aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/pathname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
-rw-r--r--Library/Homebrew/extend/pathname.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 8009e98ee..8ea1b9a93 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -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