keg_relocate: also relocate executable text files.

There are times (e.g. `ocaml`) when the `text_executable?` test will
match even although `file` does not consider it a text file. Ensure
that it's relocated in this case correctly.

References Homebrew/homebrew#41663.
Closes Homebrew/homebrew#41926.
This commit is contained in:
Mike McQuaid 2015-07-20 12:06:13 +01:00
parent 653053f184
commit 70739e9f05

View File

@ -163,7 +163,10 @@ class Keg
path.find do |pn|
next if pn.symlink? or pn.directory?
next if Metafiles::EXTENSIONS.include? pn.extname
text_files << pn if Utils.popen_read("/usr/bin/file", "--brief", pn).include?("text")
if Utils.popen_read("/usr/bin/file", "--brief", pn).include?("text") ||
pn.text_executable?
text_files << pn
end
end
text_files