parent
607605dd8f
commit
cb5da28b5c
@ -157,6 +157,17 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
when :bzip2_only
|
||||||
|
with_system_path do
|
||||||
|
target = File.basename(basename_without_params, ".bz2")
|
||||||
|
|
||||||
|
IO.popen("bunzip2 -f '#{tarball_path}' -c") do |pipe|
|
||||||
|
File.open(target, "wb") do |f|
|
||||||
|
buf = ""
|
||||||
|
f.write(buf) while pipe.read(1024, buf)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
when :gzip, :bzip2, :compress, :tar
|
when :gzip, :bzip2, :compress, :tar
|
||||||
# Assume these are also tarred
|
# Assume these are also tarred
|
||||||
# TODO check if it's really a tar archive
|
# TODO check if it's really a tar archive
|
||||||
|
|||||||
@ -213,6 +213,8 @@ class Pathname
|
|||||||
# If the filename ends with .gz not preceded by .tar
|
# If the filename ends with .gz not preceded by .tar
|
||||||
# then we want to gunzip but not tar
|
# then we want to gunzip but not tar
|
||||||
return :gzip_only
|
return :gzip_only
|
||||||
|
when ".bz2"
|
||||||
|
return :bzip2_only
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get enough of the file to detect common file types
|
# Get enough of the file to detect common file types
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user