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 <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-04-26 20:53:51 -05:00
parent 07e24dda76
commit cd4428bcb9

View File

@ -96,7 +96,7 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
when '____pkg' when '____pkg'
safe_system '/usr/sbin/pkgutil', '--expand', @tarball_path, File.basename(@url) safe_system '/usr/sbin/pkgutil', '--expand', @tarball_path, File.basename(@url)
chdir chdir
when 'Rar!' when /Rar!/
quiet_safe_system 'unrar', 'x', {:quiet_flag => '-inul'}, @tarball_path quiet_safe_system 'unrar', 'x', {:quiet_flag => '-inul'}, @tarball_path
else else
# we are assuming it is not an archive, use original filename # we are assuming it is not an archive, use original filename