diff options
| author | Jack Nagel | 2013-12-08 16:17:11 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-12-08 16:18:12 -0600 |
| commit | 3d8bf53187ee2320857976656e86582d7db2c576 (patch) | |
| tree | c4d8ba9ff3a00bf8342da7b60a03793fce5e3162 /Library | |
| parent | 0f7ae176997cafe5ff1a7fa9ee94ff370b5b76b9 (diff) | |
| download | brew-3d8bf53187ee2320857976656e86582d7db2c576.tar.bz2 | |
bottle: don't repeat output for hardlinked files
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/bottle.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index 71ed7dad6..d3eac90fa 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -43,6 +43,15 @@ module Homebrew extend self include Utils::Inreplace end + def uniq_by_ino(list) + h = {} + list.each do |e| + ino = e.stat.ino + h[ino] = e unless h.key? ino + end + h.values + end + def keg_contains string, keg if not ARGV.homebrew_developer? return quiet_system 'fgrep', '--recursive', '--quiet', '--max-count=1', string, keg @@ -52,6 +61,9 @@ module Homebrew extend self keg_ref_files = `/usr/bin/fgrep --files-with-matches --recursive "#{string}" "#{keg}" 2>/dev/null`.split("\n") keg_ref_files.map! { |file| Pathname.new(file) }.reject!(&:symlink?) + # If files are hardlinked, only check one of them + keg_ref_files = uniq_by_ino(keg_ref_files) + # If there are no files with that string found, return immediately return false if keg_ref_files.empty? |
