aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/update-report.rb
diff options
context:
space:
mode:
authorMike McQuaid2017-03-20 18:10:28 +0200
committerMike McQuaid2017-03-20 18:10:28 +0200
commit4af8bdf111b46a11c86a1b5a75e0698719ad2a1a (patch)
tree4b3e50e4da687c8ec6fb6e33d5744b8ffc43f7a0 /Library/Homebrew/cmd/update-report.rb
parent00af5250f0a7988178ed8d26520bf1a98a8dea9a (diff)
downloadbrew-4af8bdf111b46a11c86a1b5a75e0698719ad2a1a.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew/cmd/update-report.rb')
-rw-r--r--Library/Homebrew/cmd/update-report.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb
index c13d82090..00dbfe758 100644
--- a/Library/Homebrew/cmd/update-report.rb
+++ b/Library/Homebrew/cmd/update-report.rb
@@ -499,10 +499,14 @@ class Reporter
end
def migrate_formula_rename
- report[:R].each do |old_full_name, new_full_name|
- old_name = old_full_name.split("/").last
+ Formula.installed.map(&:oldname).compact.each do |old_name|
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
f = Formulary.factory(new_full_name)
rescue Exception => e