aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMax Howell2012-08-22 09:33:10 -0400
committerMax Howell2012-08-29 12:41:33 -0400
commit05991dd846ac54b10cd78453b140de8bfb259392 (patch)
tree12469a7c0e5e92fe7ade592a8a7b09fc02b27cd9 /Library/Homebrew
parentd4235197665b019263b4e28d2a8adb058035c7f7 (diff)
downloadbrew-05991dd846ac54b10cd78453b140de8bfb259392.tar.bz2
Produce good error messages for bad tarballs
Diffstat (limited to 'Library/Homebrew')
-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