aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2012-03-25 13:08:58 +0100
committerMax Howell2012-03-25 13:09:30 +0100
commitfe76848a7dd3d1cdf5d4938e271bbf9ee3a74ddb (patch)
treebf94cde7d7e05a7cb02d16a7b89c487df8df2105
parentf372dafd98d733b30df873bc2475673bcdae2527 (diff)
downloadhomebrew-fe76848a7dd3d1cdf5d4938e271bbf9ee3a74ddb.tar.bz2
Fix `brew unlink`
Whoops.
-rw-r--r--Library/Homebrew/keg.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index b7914224e..e0eba14cb 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -30,14 +30,16 @@ class Keg < Pathname
def unlink
n=0
%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?
- dst.uninstall_info if dst.to_s =~ INFOFILE_RX and ENV['HOMEBREW_KEEP_INFO']
- dst.unlink
- dst.parent.rmdir_if_possible
- n+=1
- Find.prune if src.directory?
+ src.find do |src|
+ next if src == self
+ dst=HOMEBREW_PREFIX+src.relative_path_from(self)
+ next unless dst.symlink?
+ dst.uninstall_info if dst.to_s =~ INFOFILE_RX and ENV['HOMEBREW_KEEP_INFO']
+ dst.unlink
+ dst.parent.rmdir_if_possible
+ n+=1
+ Find.prune if src.directory?
+ end
end
linked_keg_record.unlink if linked_keg_record.exist?
n