parent
06bf1c0f02
commit
268feffae4
@ -178,6 +178,7 @@ class DependencyCollector
|
|||||||
def parse_url_spec(url, tags)
|
def parse_url_spec(url, tags)
|
||||||
case File.extname(url)
|
case File.extname(url)
|
||||||
when '.xz' then Dependency.new('xz', tags)
|
when '.xz' then Dependency.new('xz', tags)
|
||||||
|
when '.lz' then Dependency.new('lzip', tags)
|
||||||
when '.rar' then Dependency.new('unrar', tags)
|
when '.rar' then Dependency.new('unrar', tags)
|
||||||
when '.7z' then Dependency.new('p7zip', tags)
|
when '.7z' then Dependency.new('p7zip', tags)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -162,6 +162,9 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
|
|||||||
when :xz
|
when :xz
|
||||||
with_system_path { safe_system "#{xzpath} -dc \"#{tarball_path}\" | tar xf -" }
|
with_system_path { safe_system "#{xzpath} -dc \"#{tarball_path}\" | tar xf -" }
|
||||||
chdir
|
chdir
|
||||||
|
when :lzip
|
||||||
|
with_system_path { safe_system "#{lzippath} -dc \"#{tarball_path}\" | tar xf -" }
|
||||||
|
chdir
|
||||||
when :pkg
|
when :pkg
|
||||||
safe_system '/usr/sbin/pkgutil', '--expand', tarball_path, basename_without_params
|
safe_system '/usr/sbin/pkgutil', '--expand', tarball_path, basename_without_params
|
||||||
chdir
|
chdir
|
||||||
@ -185,6 +188,10 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
|
|||||||
"#{HOMEBREW_PREFIX}/opt/xz/bin/xz"
|
"#{HOMEBREW_PREFIX}/opt/xz/bin/xz"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def lzippath
|
||||||
|
"#{HOMEBREW_PREFIX}/opt/lzip/bin/lzip"
|
||||||
|
end
|
||||||
|
|
||||||
def chdir
|
def chdir
|
||||||
entries = Dir['*']
|
entries = Dir['*']
|
||||||
case entries.length
|
case entries.length
|
||||||
|
|||||||
@ -141,7 +141,7 @@ class Pathname
|
|||||||
def extname(path=to_s)
|
def extname(path=to_s)
|
||||||
BOTTLE_EXTNAME_RX.match(path)
|
BOTTLE_EXTNAME_RX.match(path)
|
||||||
return $1 if $1
|
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 $1 if $1
|
||||||
return File.extname(path)
|
return File.extname(path)
|
||||||
end
|
end
|
||||||
@ -207,6 +207,7 @@ class Pathname
|
|||||||
when /^\037\235/n then :compress
|
when /^\037\235/n then :compress
|
||||||
when /^.{257}ustar/n then :tar
|
when /^.{257}ustar/n then :tar
|
||||||
when /^\xFD7zXZ\x00/n then :xz
|
when /^\xFD7zXZ\x00/n then :xz
|
||||||
|
when /^LZIP/n then :lzip
|
||||||
when /^Rar!/n then :rar
|
when /^Rar!/n then :rar
|
||||||
when /^7z\xBC\xAF\x27\x1C/n then :p7zip
|
when /^7z\xBC\xAF\x27\x1C/n then :p7zip
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user