update-report: migrate all formulae every time.

Unmigrated formulae cause hard-to-debug issues and relying on detection
on Git alone is faster but not comprehensive. Instead, iterate through
renamed, installed formulae every time and migrate them.

Closes #1770.
This commit is contained in:
Mike McQuaid 2017-03-20 18:10:28 +02:00
parent 00af5250f0
commit 4af8bdf111

View File

@ -499,10 +499,14 @@ class Reporter
end end
def migrate_formula_rename def migrate_formula_rename
report[:R].each do |old_full_name, new_full_name| Formula.installed.map(&:oldname).compact.each do |old_name|
old_name = old_full_name.split("/").last
next unless (dir = HOMEBREW_CELLAR/old_name).directory? && !dir.subdirs.empty? next unless (dir = HOMEBREW_CELLAR/old_name).directory? && !dir.subdirs.empty?
new_name = tap.formula_renames[old_name]
next unless new_name
new_full_name = "#{tap}/#{new_name}"
begin begin
f = Formulary.factory(new_full_name) f = Formulary.factory(new_full_name)
rescue Exception => e rescue Exception => e