From 719e6c8999928f45dfca2d640cd6f9a3e784e9a1 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sun, 14 Nov 2010 03:52:59 +0000 Subject: Refactor the blacklists Also don't abort searches if the query matches a blacklist. Eg. `brew search vim` should return macvim and the information that vim itself is not packaged. --- Library/Homebrew/cmd/create.rb | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) (limited to 'Library/Homebrew/cmd/create.rb') diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb index e21c9a524..8f39ce87b 100644 --- a/Library/Homebrew/cmd/create.rb +++ b/Library/Homebrew/cmd/create.rb @@ -1,4 +1,5 @@ require 'formula' +require 'blacklist' module Homebrew extend self def create @@ -26,7 +27,7 @@ module Homebrew extend self unless ARGV.force? if msg = blacklisted?(fc.name) - raise "#{msg}\n\nIf you really want to make this formula use --force." + raise "#{fc.name} is blacklisted for creation.\n#{msg}\nIf you really want to create this formula use --force." end if Formula.aliases.include? fc.name @@ -49,34 +50,6 @@ module Homebrew extend self gots = $stdin.gets.chomp if gots.empty? then nil else gots end end - - def blacklisted? name - case name.downcase - when 'vim', 'screen' then <<-EOS.undent - #{name} is blacklisted for creation - Apple distributes this program with OS X. - EOS - when 'libarchive', 'libpcap' then <<-EOS.undent - #{name} is blacklisted for creation - Apple distributes this library with OS X, you can find it in /usr/lib. - EOS - when 'libxml', 'libxlst', 'freetype', 'libpng' then <<-EOS.undent - #{name} is blacklisted for creation - Apple distributes this library with OS X, you can find it in /usr/X11/lib. - However not all build scripts look here, so you may need to call ENV.x11 or - ENV.libxml2 in your formula's install function. - EOS - when /^rubygems?$/ - "Sorry RubyGems comes with OS X so we don't package it." - when 'wxwidgets' then <<-EOS.undent - #{name} is blacklisted for creation - An older version of wxWidgets is provided by Apple with OS X, but - a formula for wxWidgets 2.8.10 is provided: - - brew install wxmac - EOS - end - end end class FormulaCreator -- cgit v1.2.3