aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-08-05 16:00:33 +0100
committerMike McQuaid2016-08-05 16:34:56 +0100
commit66d564d885c71d593277de6bad9db465ce0e0f7e (patch)
treee786077a7e4d7ee6aed2697f1c2e6582aab25015 /Library
parent3f505fe642b9f28e62b335e7622a6849646591ea (diff)
downloadbrew-66d564d885c71d593277de6bad9db465ce0e0f7e.tar.bz2
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.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/update-report.rb16
1 files changed, 13 insertions, 3 deletions
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?