aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMax Howell2009-12-17 18:45:07 +0000
committerMax Howell2009-12-17 19:17:50 +0000
commit1deb3a1fea1d855770bdc075347d49c6330e7b42 (patch)
tree2b76882656344702c70371fb93a2bef10477d08a /Library/Homebrew
parent6435413656fa81e13072c801d4433267d01c1e15 (diff)
downloadbrew-1deb3a1fea1d855770bdc075347d49c6330e7b42.tar.bz2
Don't resolve conflcts for pre-existing symlinks in HOMEBREW_PREFIX
Eg /usr/local/lib/juice/foo points somewhere else where the user has modules that he wants juice to use. Basically don't error out for stuff that isn't ours.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/keg.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index 8fdc78b4e..0085246fd 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -28,6 +28,8 @@ class Keg <Pathname
raise "#{to_s} is not a directory" unless directory?
end
+ class NotAKegError <RuntimeError; end
+
# if path is a file in a keg then this will return the containing Keg object
def self.for path
path = path.realpath
@@ -35,7 +37,7 @@ class Keg <Pathname
return Keg.new(path) if path.parent.parent == HOMEBREW_CELLAR.realpath
path = path.parent.realpath # realpath() prevents root? failing
end
- raise "#{path} is not inside a keg"
+ raise NotAKegError, "#{path} is not inside a keg"
end
def uninstall
@@ -94,6 +96,8 @@ protected
keg.link_dir(src) { :mkpath }
return true
end
+ rescue NotAKegError
+ puts "Won't resolve conflicts for symlink #{dst} as it doesn't resolve into the Cellar" if ARGV.verbose?
end
# symlinks the contents of self+foo recursively into /usr/local/foo