diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index e1f6aee5fa..9b648a5389 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -193,7 +193,16 @@ class Reporter dst = Pathname.new paths.last next unless dst.extname == ".rb" - next unless paths.any? { |p| tap.formula_file?(p) || tap.cask_file?(p)} + + if paths.any? { |p| tap.cask_file?(p) } + # Currently only need to handle Cask deletion/migration. + if status == "D" + # Have a dedicated report array for deleted casks. + @report[:DC] << tap.formula_file_to_name(src) + end + end + + next unless paths.any? { |p| tap.formula_file?(p) } case status when "A", "D" @@ -247,12 +256,13 @@ class Reporter end def migrate_tap_migration - report[:D].each do |full_name| + (report[:D] + report[:DC]).each do |full_name| name = full_name.split("/").last new_tap_name = tap.tap_migrations[name] next if new_tap_name.nil? # skip if not in tap_migrations list. - if tap == "caskroom/cask" + # This means it is a Cask + if report[:DC].include? full_name next unless (HOMEBREW_REPOSITORY/"Caskroom"/name).exist? new_tap = Tap.fetch(new_tap_name) new_tap.install unless new_tap.installed?