From cd4428bcb9c3b88d77c7416fb4d3bce242344ebf Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 26 Apr 2012 20:53:51 -0500 Subject: [PATCH] CurlDownloadStrategy: fix .rar detection We now read six bytes instead of four in order to detect xz compression; this broke rar detection which used a string literal instead of a regexp for comparison. Signed-off-by: Jack Nagel --- Library/Homebrew/download_strategy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 3a68a25417..714ba2c313 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -96,7 +96,7 @@ class CurlDownloadStrategy < AbstractDownloadStrategy when '____pkg' safe_system '/usr/sbin/pkgutil', '--expand', @tarball_path, File.basename(@url) chdir - when 'Rar!' + when /Rar!/ quiet_safe_system 'unrar', 'x', {:quiet_flag => '-inul'}, @tarball_path else # we are assuming it is not an archive, use original filename