aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2011-07-29 15:20:32 +0100
committerMax Howell2012-03-09 12:10:49 +0000
commit4696401e5d62167338bf0e9e15d66e22bb1994ac (patch)
treedbf64a25ac5b3ad1f4efc475559656c5c5402f26
parent1fb3a2e20c04f6c5715283c1c731f5d4f743e860 (diff)
downloadbrew-4696401e5d62167338bf0e9e15d66e22bb1994ac.tar.bz2
Look for bad dylibs in the installer
A common source of compile error, lets tell the user straight away. Removed relevant documentation from the installation instructions as a consequence.
-rw-r--r--install_homebrew.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/install_homebrew.rb b/install_homebrew.rb
index 7c103c0ea..08299f74b 100644
--- a/install_homebrew.rb
+++ b/install_homebrew.rb
@@ -53,6 +53,15 @@ ensure
system "/bin/stty -raw echo"
end
+def badlibs
+ @badlibs ||= begin
+ Dir['/usr/local/lib/*.dylib'].select do |dylib|
+ ENV['dylib'] = dylib
+ File.file? dylib and not File.symlink? dylib and `/usr/bin/file "$dylib"` =~ /shared library/
+ end
+ end
+end
+
####################################################################### script
abort "/usr/local/.git already exists!" unless Dir["/usr/local/.git/*"].empty?
abort "Don't run this as root!" if Process.uid == 0
@@ -119,3 +128,12 @@ sudo "/bin/chmod o-w /usr/local"
warn "/usr/local/bin is not in your PATH." unless ENV['PATH'].split(':').include? '/usr/local/bin'
warn "Now install Xcode: http://developer.apple.com/technologies/xcode.html" unless Kernel.system "/usr/bin/which -s gcc"
+
+unless badlibs.empty?
+ warn "The following *evil* dylibs exist in /usr/local/lib"
+ puts "They may break builds or worse. You should consider deleting them:"
+ puts *badlibs
+end
+
+ohai "Installation successful!"
+puts "Now type: brew help"