bottle: fix output for absolute symlinks
Closes Homebrew/homebrew#43816. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
5241932b45
commit
fe204fdf4b
@ -76,15 +76,12 @@ module Homebrew
|
||||
Utils.popen_read("strings", "-t", "x", "-", file.to_s) do |io|
|
||||
until io.eof?
|
||||
str = io.readline.chomp
|
||||
|
||||
next if ignores.any? { |i| i =~ str }
|
||||
|
||||
next unless str.include? string
|
||||
|
||||
offset, match = str.split(" ", 2)
|
||||
|
||||
next if linked_libraries.include? match # Don't bother reporting a string if it was found by otool
|
||||
result ||= true
|
||||
|
||||
result = true
|
||||
|
||||
if ARGV.verbose?
|
||||
print_filename string, file
|
||||
@ -94,19 +91,36 @@ module Homebrew
|
||||
end
|
||||
end
|
||||
|
||||
put_symlink_header = false
|
||||
absolute_symlinks_start_with_string = []
|
||||
absolute_symlinks_rest = []
|
||||
keg.find do |pn|
|
||||
if pn.symlink? && (link = pn.readlink).absolute?
|
||||
if !put_symlink_header && link.to_s.start_with?(string)
|
||||
opoo "Absolute symlink starting with #{string}:"
|
||||
puts " #{pn} -> #{pn.resolved_path}"
|
||||
put_symlink_header = true
|
||||
if link.to_s.start_with?(string)
|
||||
absolute_symlinks_start_with_string << pn
|
||||
else
|
||||
absolute_symlinks_rest << pn
|
||||
end
|
||||
|
||||
result = true
|
||||
end
|
||||
end
|
||||
|
||||
if ARGV.verbose?
|
||||
if absolute_symlinks_start_with_string.any?
|
||||
opoo "Absolute symlink starting with #{string}:"
|
||||
absolute_symlinks_start_with_string.each do |pn|
|
||||
puts " #{pn} -> #{pn.resolved_path}"
|
||||
end
|
||||
end
|
||||
|
||||
if absolute_symlinks_rest.any?
|
||||
opoo "Absolute symlink:"
|
||||
absolute_symlinks_rest.each do |pn|
|
||||
puts " #{pn} -> #{pn.resolved_path}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user