diff options
| author | Jack Nagel | 2013-06-07 16:34:52 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-06-07 16:35:21 -0500 |
| commit | 4eccac39805a1a0032c72c066dbdf130b4b9c5bd (patch) | |
| tree | 0ca9259614a39b840c7431a61da8f581b6ef067c /Library | |
| parent | d7f858ff0434afa7066793bcfc0ace979b9521d2 (diff) | |
| download | homebrew-4eccac39805a1a0032c72c066dbdf130b4b9c5bd.tar.bz2 | |
CurlDownloadStrategy: use opt path for xz
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index b615fc2c9..87f8f85e1 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -114,10 +114,8 @@ class CurlDownloadStrategy < AbstractDownloadStrategy with_system_path { safe_system 'tar', 'xf', @tarball_path } chdir when :xz - raise "You must install XZutils: brew install xz" unless which "xz" - with_system_path { - safe_system "#{Formula.factory('xz').bin}/xz -dc \"#{@tarball_path}\" | tar xf -" - } + raise "You must install XZutils: brew install xz" unless File.executable? xzpath + with_system_path { safe_system "#{xzpath} -dc \"#{@tarball_path}\" | tar xf -" } chdir when :pkg safe_system '/usr/sbin/pkgutil', '--expand', @tarball_path, File.basename(@url) @@ -142,6 +140,10 @@ class CurlDownloadStrategy < AbstractDownloadStrategy private + def xzpath + "#{HOMEBREW_PREFIX}/opt/xz/bin/xz" + end + def chdir entries=Dir['*'] case entries.length |
