diff options
| author | Mike McQuaid | 2017-12-04 08:46:23 +0000 |
|---|---|---|
| committer | GitHub | 2017-12-04 08:46:23 +0000 |
| commit | 4f5e938a5dbe049e05dea19495b6547acc5c5b5b (patch) | |
| tree | fec9016d552cd9290ef89dfdac5523822b3bce9c /Library/Homebrew/extend/os/linux | |
| parent | 0ad42ebbcb735422612a7c6d4edc5ad88044dd4b (diff) | |
| parent | d79c5ade1abaad0fb1ea88f2b949def8dcfddb81 (diff) | |
| download | brew-1.3.9.tar.bz2 | |
Merge pull request #3517 from sjackman/linkage1.3.9
Implement linkage for Linux
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 |
