diff options
| author | Max Howell | 2011-08-02 12:00:30 +0100 |
|---|---|---|
| committer | Max Howell | 2011-08-02 12:22:58 +0100 |
| commit | b36dcc4ffde9a4f7419e9f876eac6ee77aaf3338 (patch) | |
| tree | 2445f9aa1fabf4ef975075ac8311798d4eb24a96 | |
| parent | 6726fe090f4c9c719f498a8002ae5f270e389a04 (diff) | |
| download | brew-b36dcc4ffde9a4f7419e9f876eac6ee77aaf3338.tar.bz2 | |
Improve compatibility for old formula
Allow compatibility to be disabled with --no-compat or HOMEBREW_NO_COMPAT environment variable.
| -rw-r--r-- | Library/Homebrew/compat/brewkit.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/compat/compatibility.rb (renamed from Library/Homebrew/compatibility.rb) | 2 | ||||
| -rw-r--r-- | Library/Homebrew/global.rb | 6 |
3 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/compat/brewkit.rb b/Library/Homebrew/compat/brewkit.rb new file mode 100644 index 000000000..59a0bf150 --- /dev/null +++ b/Library/Homebrew/compat/brewkit.rb @@ -0,0 +1,3 @@ +# here so that formula from the repo that are very old can still be installed + +require 'formula' diff --git a/Library/Homebrew/compatibility.rb b/Library/Homebrew/compat/compatibility.rb index 5bc76d3ff..ac94feff8 100644 --- a/Library/Homebrew/compatibility.rb +++ b/Library/Homebrew/compat/compatibility.rb @@ -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 diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index d390d7d3c..7e6f38949 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -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 |
