parent
06bf1c0f02
commit
268feffae4
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user