aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/outdated.rb8
-rw-r--r--Library/Homebrew/migrator.rb9
2 files changed, 17 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb
index 673ea966c..45e195939 100644
--- a/Library/Homebrew/cmd/outdated.rb
+++ b/Library/Homebrew/cmd/outdated.rb
@@ -1,5 +1,6 @@
require "formula"
require "keg"
+require "migrator"
module Homebrew
def outdated
@@ -16,6 +17,13 @@ module Homebrew
formulae.map do |f|
all_versions = []
older_or_same_tap_versions = []
+
+ if f.oldname && !f.rack.exist?
+ if Pathname.new("#{HOMEBREW_CELLAR}/#{f.oldname}").exist?
+ raise Migrator::MigrationNeededError.new(f)
+ end
+ end
+
f.rack.subdirs.each do |dir|
keg = Keg.new dir
version = keg.version
diff --git a/Library/Homebrew/migrator.rb b/Library/Homebrew/migrator.rb
index 0ad02ab01..fb01cf7f3 100644
--- a/Library/Homebrew/migrator.rb
+++ b/Library/Homebrew/migrator.rb
@@ -4,6 +4,15 @@ require "tab"
require "tap_migrations"
class Migrator
+ class MigrationNeededError < RuntimeError
+ def initialize(formula)
+ super <<-EOS.undent
+ #{formula.oldname} was renamed to #{formula.name} and needs to be migrated.
+ Please run `brew migrate #{formula.oldname}`
+ EOS
+ end
+ end
+
class MigratorNoOldnameError < RuntimeError
def initialize(formula)
super "#{formula.name} doesn't replace any formula."