migrator: tweak more messaging.
- Make it clearer what the migrator is doing and why - Recommend an unconditional brew upgrade
This commit is contained in:
parent
bc3389bdae
commit
1a51d7fb44
@ -183,7 +183,7 @@ class Migrator
|
|||||||
end
|
end
|
||||||
|
|
||||||
def migrate
|
def migrate
|
||||||
oh1 "Migrating #{Formatter.identifier(oldname)} to #{Formatter.identifier(newname)}"
|
oh1 "Processing #{Formatter.identifier(oldname)} formula rename to #{Formatter.identifier(newname)}"
|
||||||
lock
|
lock
|
||||||
unlink_oldname
|
unlink_oldname
|
||||||
unlink_newname if new_cellar.exist?
|
unlink_newname if new_cellar.exist?
|
||||||
@ -195,7 +195,10 @@ class Migrator
|
|||||||
update_tabs
|
update_tabs
|
||||||
return unless formula.outdated?
|
return unless formula.outdated?
|
||||||
opoo <<~EOS
|
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}
|
brew upgrade #{newname}
|
||||||
EOS
|
EOS
|
||||||
rescue Interrupt
|
rescue Interrupt
|
||||||
@ -231,7 +234,7 @@ class Migrator
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
oh1 "Moving #{Formatter.identifier(oldname)} children"
|
oh1 "Moving #{Formatter.identifier(oldname)} versions to #{new_cellar}"
|
||||||
if new_cellar.exist?
|
if new_cellar.exist?
|
||||||
FileUtils.mv(old_cellar.children, new_cellar)
|
FileUtils.mv(old_cellar.children, new_cellar)
|
||||||
else
|
else
|
||||||
@ -266,7 +269,7 @@ class Migrator
|
|||||||
end
|
end
|
||||||
|
|
||||||
def unlink_newname
|
def unlink_newname
|
||||||
oh1 "Unlinking #{Formatter.identifier(newname)}"
|
oh1 "Temporarily unlinking #{Formatter.identifier(newname)}"
|
||||||
new_cellar.subdirs.each do |d|
|
new_cellar.subdirs.each do |d|
|
||||||
keg = Keg.new(d)
|
keg = Keg.new(d)
|
||||||
keg.unlink
|
keg.unlink
|
||||||
@ -274,7 +277,7 @@ class Migrator
|
|||||||
end
|
end
|
||||||
|
|
||||||
def link_newname
|
def link_newname
|
||||||
oh1 "Linking #{Formatter.identifier(newname)}"
|
oh1 "Relinking #{Formatter.identifier(newname)}"
|
||||||
new_keg = Keg.new(new_linked_keg_record)
|
new_keg = Keg.new(new_linked_keg_record)
|
||||||
|
|
||||||
# If old_keg wasn't linked then we just optlink a keg.
|
# If old_keg wasn't linked then we just optlink a keg.
|
||||||
|
|||||||
@ -29,7 +29,7 @@ describe "brew migrate", :integration_test do
|
|||||||
install_and_rename_coretap_formula "testball1", "testball2"
|
install_and_rename_coretap_formula "testball1", "testball2"
|
||||||
|
|
||||||
expect { brew "migrate", "testball1" }
|
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 not_to_output.to_stderr
|
||||||
.and be_a_success
|
.and be_a_success
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user