Add support for extracting LHA archives

This commit is contained in:
Misty De Meo 2015-04-26 11:11:33 -07:00
parent 1f80d93d1b
commit 8fe0b56810
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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