From d79c5ade1abaad0fb1ea88f2b949def8dcfddb81 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Fri, 1 Dec 2017 16:43:00 -0800 Subject: [PATCH] Implement linkage for Linux --- Library/Homebrew/extend/pathname.rb | 4 ++++ Library/Homebrew/os/mac/linkage_checker.rb | 2 +- Library/Homebrew/os/mac/mach.rb | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 82cf10be07..32d57c1c4d 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -470,6 +470,10 @@ class Pathname end } end + + def mach_o_bundle? + false + end end require "extend/os/pathname" diff --git a/Library/Homebrew/os/mac/linkage_checker.rb b/Library/Homebrew/os/mac/linkage_checker.rb index f6aa4c2f33..941a5a847a 100644 --- a/Library/Homebrew/os/mac/linkage_checker.rb +++ b/Library/Homebrew/os/mac/linkage_checker.rb @@ -23,7 +23,7 @@ class LinkageChecker def check_dylibs @keg.find do |file| next if file.symlink? || file.directory? - next unless file.dylib? || file.mach_o_executable? || file.mach_o_bundle? + next unless file.dylib? || file.binary_executable? || file.mach_o_bundle? # weakly loaded dylibs may not actually exist on disk, so skip them # when checking for broken linkage diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index 9b53c49797..9586188692 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -103,6 +103,8 @@ module MachOShim mach_data.any? { |m| m.fetch(:type) == :executable } end + alias binary_executable? mach_o_executable? + # @private def mach_o_bundle? mach_data.any? { |m| m.fetch(:type) == :bundle }