diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 2c141f0117..e7aa895382 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -178,6 +178,7 @@ class DependencyCollector def parse_url_spec(url, tags) case File.extname(url) when '.xz' then Dependency.new('xz', tags) + when '.lz' then Dependency.new('lzip', tags) when '.rar' then Dependency.new('unrar', tags) when '.7z' then Dependency.new('p7zip', tags) end diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 2fe25d1590..b09c296cf4 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -162,6 +162,9 @@ class CurlDownloadStrategy < AbstractDownloadStrategy when :xz with_system_path { safe_system "#{xzpath} -dc \"#{tarball_path}\" | tar xf -" } chdir + when :lzip + with_system_path { safe_system "#{lzippath} -dc \"#{tarball_path}\" | tar xf -" } + chdir when :pkg safe_system '/usr/sbin/pkgutil', '--expand', tarball_path, basename_without_params chdir @@ -185,6 +188,10 @@ class CurlDownloadStrategy < AbstractDownloadStrategy "#{HOMEBREW_PREFIX}/opt/xz/bin/xz" end + def lzippath + "#{HOMEBREW_PREFIX}/opt/lzip/bin/lzip" + end + def chdir entries = Dir['*'] case entries.length diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index ecccc00c62..30cb44d98e 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -141,7 +141,7 @@ class Pathname def extname(path=to_s) BOTTLE_EXTNAME_RX.match(path) return $1 if $1 - /(\.(tar|cpio|pax)\.(gz|bz2|xz|Z))$/.match(path) + /(\.(tar|cpio|pax)\.(gz|bz2|lz|xz|Z))$/.match(path) return $1 if $1 return File.extname(path) end @@ -207,6 +207,7 @@ class Pathname when /^\037\235/n then :compress when /^.{257}ustar/n then :tar when /^\xFD7zXZ\x00/n then :xz + when /^LZIP/n then :lzip when /^Rar!/n then :rar when /^7z\xBC\xAF\x27\x1C/n then :p7zip else