Fix some places where encoding issues manifest on ruby 2.0
This commit is contained in:
parent
8cb980f7be
commit
d29d5d7e92
@ -67,7 +67,7 @@ module Homebrew extend self
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Use strings to search through the file for each string
|
# Use strings to search through the file for each string
|
||||||
IO.popen("strings -t x - '#{file}'") do |io|
|
IO.popen("strings -t x - '#{file}'", "rb") do |io|
|
||||||
until io.eof?
|
until io.eof?
|
||||||
str = io.readline.chomp
|
str = io.readline.chomp
|
||||||
|
|
||||||
|
|||||||
@ -144,7 +144,7 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
|
|||||||
def buffered_write(tool)
|
def buffered_write(tool)
|
||||||
target = File.basename(basename_without_params, tarball_path.extname)
|
target = File.basename(basename_without_params, tarball_path.extname)
|
||||||
|
|
||||||
IO.popen("#{tool} -f '#{tarball_path}' -c") do |pipe|
|
IO.popen("#{tool} -f '#{tarball_path}' -c", "rb") do |pipe|
|
||||||
File.open(target, "wb") do |f|
|
File.open(target, "wb") do |f|
|
||||||
buf = ""
|
buf = ""
|
||||||
f.write(buf) while pipe.read(1024, buf)
|
f.write(buf) while pipe.read(1024, buf)
|
||||||
|
|||||||
@ -86,7 +86,7 @@ class Keg < Pathname
|
|||||||
end
|
end
|
||||||
|
|
||||||
def each_unique_file_matching string
|
def each_unique_file_matching string
|
||||||
IO.popen("/usr/bin/fgrep -lr '#{string}' '#{self}' 2>/dev/null") do |io|
|
IO.popen("/usr/bin/fgrep -lr '#{string}' '#{self}' 2>/dev/null", "rb") do |io|
|
||||||
hardlinks = Set.new
|
hardlinks = Set.new
|
||||||
|
|
||||||
until io.eof?
|
until io.eof?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user