aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2013-11-29 10:10:28 -0800
committerAdam Vandenberg2013-11-29 15:18:49 -0800
commit268feffae410c389a4d1483198fded8e93554857 (patch)
treec3dd096983f58e532c06b4a8cf453b460b230fea /Library
parent06bf1c0f0201d24f480c5fa3488f9bc57abf7858 (diff)
downloadbrew-268feffae410c389a4d1483198fded8e93554857.tar.bz2
support .lz archives
Closes Homebrew/homebrew#24775.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dependency_collector.rb1
-rw-r--r--Library/Homebrew/download_strategy.rb7
-rw-r--r--Library/Homebrew/extend/pathname.rb3
3 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb
index 2c141f011..e7aa89538 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 2fe25d159..b09c296cf 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 ecccc00c6..30cb44d98 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