Fix :gzip_only extraction
gunzip can only extract files in-place, so just shelling out to gunzip was actually leaving the uncompressed file in Homebrew's cache, not in the temporary directory. (It also destroyed the original compressed file.)
This commit is contained in:
parent
49acf70813
commit
ecfb175cdc
@ -103,7 +103,15 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
|
|||||||
with_system_path { quiet_safe_system 'unzip', {:quiet_flag => '-qq'}, @tarball_path }
|
with_system_path { quiet_safe_system 'unzip', {:quiet_flag => '-qq'}, @tarball_path }
|
||||||
chdir
|
chdir
|
||||||
when :gzip_only
|
when :gzip_only
|
||||||
with_system_path { safe_system 'gunzip', '-f', @tarball_path }
|
# gunzip writes the compressed data in the location of the original,
|
||||||
|
# regardless of the current working directory; the only way to
|
||||||
|
# write elsewhere is to use the stdout
|
||||||
|
with_system_path do
|
||||||
|
data = `gunzip -f "#{@tarball_path}" -c`
|
||||||
|
File.open(File.basename(basename_without_params, '.gz'), 'w') do |f|
|
||||||
|
f.write data
|
||||||
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user