aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/os/mac/keg_relocate.rb6
-rw-r--r--Library/Homebrew/keg_relocate.rb13
2 files changed, 13 insertions, 6 deletions
diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb
index 476e5da4a..7b5bb11f9 100644
--- a/Library/Homebrew/extend/os/mac/keg_relocate.rb
+++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb
@@ -131,6 +131,12 @@ class Keg
mach_o_files
end
+ def recursive_fgrep_args
+ # Don't recurse into symlinks; the man page says this is the default, but
+ # it's wrong. -O is a BSD-grep-only option.
+ "-lrO"
+ end
+
def self.file_linked_libraries(file, string)
# Check dynamic library linkage. Importantly, do not perform for static
# libraries, which will falsely report "linkage" to themselves.
diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb
index 0b1a1bc94..9a9902584 100644
--- a/Library/Homebrew/keg_relocate.rb
+++ b/Library/Homebrew/keg_relocate.rb
@@ -98,13 +98,14 @@ class Keg
[]
end
+ def recursive_fgrep_args
+ # for GNU grep; overridden for BSD grep on OS X
+ "-lr"
+ end
+ alias generic_recursive_fgrep_args recursive_fgrep_args
+
def each_unique_file_matching(string)
- bsd = `/usr/bin/fgrep -V`.include?("BSD grep")
- grep_args = "-lr"
- # Don't recurse into symlinks; the man page says this is the default, but
- # it's wrong.
- grep_args += "O" if bsd
- Utils.popen_read("/usr/bin/fgrep", grep_args, string, to_s) do |io|
+ Utils.popen_read("/usr/bin/fgrep", recursive_fgrep_args, string, to_s) do |io|
hardlinks = Set.new
until io.eof?