From 69672ca965150196f2cd277eca5958cd574aec61 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sun, 25 Mar 2012 11:07:30 +0100 Subject: [PATCH] Speed-up brew-unlink under certain conditions This massively speeds up upgrades for certain formula, ie. formula with lots of files that aren't in the directories we link. I found upgrading android took ages before the un-tar step and it was indeed for this reason. --- Library/Homebrew/keg.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index c3a5443f1e..b7914224e3 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -29,7 +29,7 @@ class Keg < Pathname def unlink n=0 - Pathname.new(self).find do |src| + %w[bin etc lib include sbin share var].map{ |d| self/d }.each do |src| next if src == self dst=HOMEBREW_PREFIX+src.relative_path_from(self) next unless dst.symlink?