brew/Library/Homebrew/cmd/reinstall.rb

31 lines
776 B
Ruby
Raw Normal View History

#: * `reinstall` [`--display-times`] <formula>:
#: Uninstall and then install <formula> (with existing install options).
#:
#: If `--display-times` is passed, install times for each formula are printed
#: at the end of the run.
2016-04-08 16:28:43 +02:00
2014-10-31 20:10:08 -05:00
require "formula_installer"
require "development_tools"
require "messages"
require "reinstall"
2013-02-17 13:23:41 +00:00
module Homebrew
2016-09-26 01:44:51 +02:00
module_function
2013-02-17 13:23:41 +00:00
def reinstall
FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed?
Install.perform_preinstall_checks
2016-09-05 22:40:08 +03:00
ARGV.resolved_formulae.each do |f|
if f.pinned?
onoe "#{f.full_name} is pinned. You must unpin it to reinstall."
next
end
Migrator.migrate_if_needed(f)
2016-09-05 22:40:08 +03:00
reinstall_formula(f)
end
Homebrew.messages.display_messages
end
2013-02-17 13:23:41 +00:00
end