aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorWilliam Woodruff2016-06-24 21:27:52 -0400
committerTim D. Smith2016-06-27 22:56:12 -0700
commit3e5e14a59580325faf397b48d62a52f0013a17f2 (patch)
treef0af54e64fd0bdbdf3f612ed63aa6959a348d192 /Library
parent1668e47d1ea9e7b4c0297474bc18a2858c189850 (diff)
downloadbrew-3e5e14a59580325faf397b48d62a52f0013a17f2.tar.bz2
keg_relocate: Exclude hardlinks from mach_o_files.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg_relocate.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb
index b1a72f1ef..d436225f7 100644
--- a/Library/Homebrew/keg_relocate.rb
+++ b/Library/Homebrew/keg_relocate.rb
@@ -157,8 +157,12 @@ class Keg
end
def mach_o_files
+ hardlinks = Set.new
mach_o_files = []
path.find do |pn|
+ # if we've already processed a file, ignore its hardlinks (which have the same dev ID and inode)
+ # this prevents relocations from being performed on a binary more than once
+ next unless hardlinks.add? [pn.stat.dev, pn.stat.ino]
next if pn.symlink? || pn.directory?
mach_o_files << pn if pn.dylib? || pn.mach_o_bundle? || pn.mach_o_executable?
end