From 1a51d7fb4480c9272c39b520283bfe93cd112151 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 5 Mar 2018 10:14:39 +0000 Subject: [PATCH] migrator: tweak more messaging. - Make it clearer what the migrator is doing and why - Recommend an unconditional brew upgrade --- Library/Homebrew/migrator.rb | 13 ++++++++----- Library/Homebrew/test/cmd/migrate_spec.rb | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/migrator.rb b/Library/Homebrew/migrator.rb index 7287a3c88c..503f889852 100644 --- a/Library/Homebrew/migrator.rb +++ b/Library/Homebrew/migrator.rb @@ -183,7 +183,7 @@ class Migrator end def migrate - oh1 "Migrating #{Formatter.identifier(oldname)} to #{Formatter.identifier(newname)}" + oh1 "Processing #{Formatter.identifier(oldname)} formula rename to #{Formatter.identifier(newname)}" lock unlink_oldname unlink_newname if new_cellar.exist? @@ -195,7 +195,10 @@ class Migrator update_tabs return unless formula.outdated? opoo <<~EOS - #{Formatter.identifier(newname)} is outdated! Please run as soon as possible: + #{Formatter.identifier(newname)} is outdated! + To avoid broken installations, as soon as possible please run: + brew upgrade + Or, if you're OK with a less reliable fix: brew upgrade #{newname} EOS rescue Interrupt @@ -231,7 +234,7 @@ class Migrator end end - oh1 "Moving #{Formatter.identifier(oldname)} children" + oh1 "Moving #{Formatter.identifier(oldname)} versions to #{new_cellar}" if new_cellar.exist? FileUtils.mv(old_cellar.children, new_cellar) else @@ -266,7 +269,7 @@ class Migrator end def unlink_newname - oh1 "Unlinking #{Formatter.identifier(newname)}" + oh1 "Temporarily unlinking #{Formatter.identifier(newname)}" new_cellar.subdirs.each do |d| keg = Keg.new(d) keg.unlink @@ -274,7 +277,7 @@ class Migrator end def link_newname - oh1 "Linking #{Formatter.identifier(newname)}" + oh1 "Relinking #{Formatter.identifier(newname)}" new_keg = Keg.new(new_linked_keg_record) # If old_keg wasn't linked then we just optlink a keg. diff --git a/Library/Homebrew/test/cmd/migrate_spec.rb b/Library/Homebrew/test/cmd/migrate_spec.rb index 18c94fa018..83dee0cb65 100644 --- a/Library/Homebrew/test/cmd/migrate_spec.rb +++ b/Library/Homebrew/test/cmd/migrate_spec.rb @@ -29,7 +29,7 @@ describe "brew migrate", :integration_test do install_and_rename_coretap_formula "testball1", "testball2" expect { brew "migrate", "testball1" } - .to output(/Migrating testball1 to testball2/).to_stdout + .to output(/Processing testball1 formula rename to testball2/).to_stdout .and not_to_output.to_stderr .and be_a_success end