From 66d564d885c71d593277de6bad9db465ce0e0f7e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 5 Aug 2016 16:00:33 +0100 Subject: update-report: tweak Cask migration output. No longer output every cask under the list of changed formulae but instead create a dedicated, unprinted report section for casks and then iterate through that instead. --- Library/Homebrew/cmd/update-report.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index e1f6aee5f..9b648a538 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? -- cgit v1.2.3