diff options
Diffstat (limited to 'Library/Homebrew/extend/os/linux')
| -rw-r--r-- | Library/Homebrew/extend/os/linux/extend/pathname.rb | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/Library/Homebrew/extend/os/linux/extend/pathname.rb b/Library/Homebrew/extend/os/linux/extend/pathname.rb index eb6ea409b..604351da7 100644 --- a/Library/Homebrew/extend/os/linux/extend/pathname.rb +++ b/Library/Homebrew/extend/os/linux/extend/pathname.rb @@ -1,19 +1,5 @@ -class Pathname - # @private - def elf? - # See: https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header - read(4) == "\x7fELF" - end +require "os/linux/elf" - # @private - def dynamic_elf? - if which "readelf" - popen_read("readelf", "-l", to_path).include?(" DYNAMIC ") - elsif which "file" - !popen_read("file", "-L", "-b", to_path)[/dynamic|shared/].nil? - else - raise StandardError, "Neither `readelf` nor `file` is available "\ - "to determine whether '#{self}' is dynamically or statically linked." - end - end +class Pathname + prepend ELFShim end |
