From 0b5ab621a591d36338570ae8ee325150a48bb946 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 26 Apr 2015 11:11:33 -0700 Subject: Add support for extracting LHA archives --- Library/Homebrew/download_strategy.rb | 6 ++++++ Library/Homebrew/extend/pathname.rb | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 40e2314a2..1914db8df 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -63,6 +63,10 @@ class AbstractDownloadStrategy "#{HOMEBREW_PREFIX}/opt/lzip/bin/lzip" end + def lhapath + "#{HOMEBREW_PREFIX}/opt/lha/bin/lha" + end + def cvspath @cvspath ||= %W[ /usr/bin/cvs @@ -192,6 +196,8 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy when :lzip with_system_path { pipe_to_tar(lzippath) } chdir + when :lha + safe_system lhapath, "x", cached_location when :xar safe_system "/usr/bin/xar", "-xf", cached_location when :rar diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 1e80e3e84..ee8d8c9f4 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -211,6 +211,8 @@ class Pathname return :gzip_only when ".bz2" return :bzip2_only + when ".lha", ".lzh" + return :lha end # Get enough of the file to detect common file types -- cgit v1.2.3