diff options
| author | Zhiming Wang | 2016-12-25 18:54:08 -0500 | 
|---|---|---|
| committer | Mike McQuaid | 2017-03-20 18:20:31 +0200 | 
| commit | 1c10a6260fb4f4036d68b4c34acc6135b26b93d6 (patch) | |
| tree | 2924c8b8295cbe1a60a6d5980f3a656c67387cc1 /Library/Homebrew/cmd/info.rb | |
| parent | 00af5250f0a7988178ed8d26520bf1a98a8dea9a (diff) | |
| download | brew-1c10a6260fb4f4036d68b4c34acc6135b26b93d6.tar.bz2 | |
Hint at new location of migrated formulae
Partial implementation of
https://github.com/Homebrew/brew-evolution/pull/15, along with the ability to
search for deleted formulae in git history (inspired by #1996) which is not
described in the proposal.
See also: #1371.
Diffstat (limited to 'Library/Homebrew/cmd/info.rb')
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 22 | 
1 files changed, 19 insertions, 3 deletions
| diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index b7de0005c..2d5e34ce2 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -23,6 +23,7 @@ require "formula"  require "keg"  require "tab"  require "json" +require "historic"  module Homebrew    module_function @@ -54,10 +55,25 @@ module Homebrew            else              info_formula Formulary.find_with_priority(f)            end -        rescue FormulaUnavailableError +        rescue FormulaUnavailableError => e            # No formula with this name, try a blacklist lookup -          raise unless (blacklist = blacklisted?(f)) -          puts blacklist +          if (blacklist = blacklisted?(f)) +            ofail "#{e.message}\n#{blacklist}" +          else +            ofail e.message + +            # No point in searching if the specified tap isn't tapped yet +            next if e.instance_of?(TapFormulaUnavailableError) && !e.tap.installed? + +            migrations = search_for_migrated_formula(f) +            next unless migrations.empty? +            ohai "Searching among deleted formulae..." +            begin +              search_for_deleted_formula(f) +            rescue +              nil +            end +          end          end        end      end | 
