CurlDownloadStrategy: use opt path for xz

This commit is contained in:
Jack Nagel 2013-06-07 16:34:52 -05:00
parent fa7291f21b
commit a8f5527f74

View File

@ -114,10 +114,8 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
with_system_path { safe_system 'tar', 'xf', @tarball_path } with_system_path { safe_system 'tar', 'xf', @tarball_path }
chdir chdir
when :xz when :xz
raise "You must install XZutils: brew install xz" unless which "xz" raise "You must install XZutils: brew install xz" unless File.executable? xzpath
with_system_path { with_system_path { safe_system "#{xzpath} -dc \"#{@tarball_path}\" | tar xf -" }
safe_system "#{Formula.factory('xz').bin}/xz -dc \"#{@tarball_path}\" | tar xf -"
}
chdir chdir
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)
@ -142,6 +140,10 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
private private
def xzpath
"#{HOMEBREW_PREFIX}/opt/xz/bin/xz"
end
def chdir def chdir
entries=Dir['*'] entries=Dir['*']
case entries.length case entries.length