Merge pull request #1766 from MikeMcQuaid/update-report-incoming-renames

update-report: handle homebrew/versions imports.
This commit is contained in:
Mike McQuaid 2017-01-02 20:42:57 +00:00 committed by GitHub
commit 538028a735

View File

@ -387,7 +387,7 @@ class Reporter
end end
end end
renamed_formulae = [] renamed_formulae = Set.new
@report[:D].each do |old_full_name| @report[:D].each do |old_full_name|
old_name = old_full_name.split("/").last old_name = old_full_name.split("/").last
new_name = tap.formula_renames[old_name] new_name = tap.formula_renames[old_name]
@ -402,10 +402,24 @@ class Reporter
renamed_formulae << [old_full_name, new_full_name] if @report[:A].include? new_full_name renamed_formulae << [old_full_name, new_full_name] if @report[:A].include? new_full_name
end end
@report[:A].each do |new_full_name|
new_name = new_full_name.split("/").last
old_name = tap.formula_renames.key(new_name)
next unless old_name
if tap.core_tap?
old_full_name = old_name
else
old_full_name = "#{tap}/#{old_name}"
end
renamed_formulae << [old_full_name, new_full_name]
end
unless renamed_formulae.empty? unless renamed_formulae.empty?
@report[:A] -= renamed_formulae.map(&:last) @report[:A] -= renamed_formulae.map(&:last)
@report[:D] -= renamed_formulae.map(&:first) @report[:D] -= renamed_formulae.map(&:first)
@report[:R] = renamed_formulae @report[:R] = renamed_formulae.to_a
end end
@report @report