aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/create.rb
diff options
context:
space:
mode:
authorMax Howell2010-11-14 03:52:59 +0000
committerAdam Vandenberg2011-03-12 11:55:02 -0800
commit719e6c8999928f45dfca2d640cd6f9a3e784e9a1 (patch)
tree7326f00409608fcb06b57467fa6f2c451593c0d0 /Library/Homebrew/cmd/create.rb
parentcf295690995c579e80c2dfdd1e2fc091c6431f26 (diff)
downloadbrew-719e6c8999928f45dfca2d640cd6f9a3e784e9a1.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew/cmd/create.rb')
-rw-r--r--Library/Homebrew/cmd/create.rb31
1 files changed, 2 insertions, 29 deletions
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