Improve compatibility for old formula

Allow compatibility to be disabled with --no-compat or HOMEBREW_NO_COMPAT environment variable.
This commit is contained in:
Max Howell 2011-08-02 12:00:30 +01:00
parent 6726fe090f
commit b36dcc4ffd
3 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,3 @@
# here so that formula from the repo that are very old can still be installed
require 'formula'

View File

@ -76,5 +76,7 @@ class Formula
def fails_with_llvm msg=nil, data=nil
handle_llvm_failure FailsWithLLVM.new(msg, data)
end
end
class UnidentifiedFormula < Formula
end

View File

@ -3,7 +3,6 @@ require 'extend/ARGV'
require 'extend/string'
require 'utils'
require 'exceptions'
require 'compatibility'
ARGV.extend(HomebrewArgvExtension)
@ -58,3 +57,8 @@ end
FORMULA_META_FILES = %w[README README.md ChangeLog COPYING LICENSE LICENCE COPYRIGHT AUTHORS]
PLEASE_REPORT_BUG = "#{Tty.white}Please report this bug: #{Tty.em}https://github.com/mxcl/homebrew/wiki/Checklist-before-filing-a-new-issue#{Tty.reset}"
unless ARGV.include? "--no-compat" or ENV['HOMEBREW_NO_COMPAT']
$:.unshift(File.expand_path("#{__FILE__}/../compat"))
require 'compatibility'
end