aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index 8ba55f5ee..ad744e840 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -28,6 +28,19 @@ class Keg <Pathname
parent.rmdir_if_possible
end
+ def unlink
+ n=0
+ Pathname.new(self).find do |src|
+ next if src == self
+ dst=HOMEBREW_PREFIX+src.relative_path_from(self)
+ next unless dst.symlink?
+ dst.unlink
+ n+=1
+ Find.prune if src.directory?
+ end
+ n
+ end
+
def link
$n=0
$d=0