diff options
| author | Jack Nagel | 2013-12-05 16:39:39 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-12-05 16:39:39 -0600 |
| commit | 7fcda041de0cdfb5e5ae971be1948d812cab73b2 (patch) | |
| tree | 44feaaebf5d54707be40c39fc2d9eba3cead931d /Library/Homebrew/cmd | |
| parent | 7f195edef784039235ed1b59d297f86fd09df29c (diff) | |
| download | homebrew-7fcda041de0cdfb5e5ae971be1948d812cab73b2.tar.bz2 | |
bottle: fix false-positives from static libs when checking relocatability
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/bottle.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index 2f5accf5e..12eff8831 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -60,13 +60,15 @@ module Homebrew extend self keg_ref_files.each do |file| puts "#{Tty.red}#{file}#{Tty.reset}" - # If we can't use otool on this file, just skip to the next file - next if not file.mach_o_executable? and not file.mach_o_bundle? and not file.dylib? and not file.extname == '.a' - - # Get all libraries this file links to, then display only links to libraries that contain string in the path - linked_libraries = `otool -L "#{file}"`.split("\n").drop(1) - linked_libraries.map!{ |lib| lib.strip.split()[0] } - linked_libraries = linked_libraries.select{ |lib| lib.include? string } + linked_libraries = [] + + # Check dynamic library linkage. Importantly, do not run otool on static + # libraries, which will falsely report "linkage" to themselves. + if file.mach_o_executable? or file.dylib? or file.mach_o_bundle? + linked_libraries.concat `otool -L "#{file}"`.split("\n").drop(1) + linked_libraries.map! { |lib| lib[Keg::OTOOL_RX, 1] } + linked_libraries = linked_libraries.select { |lib| lib.include? string } + end linked_libraries.each do |lib| puts " #{Tty.gray}-->#{Tty.reset} links to #{lib}" |
