| 
									
										
										
										
											2018-06-20 00:54:14 -04:00
										 |  |  | #:  * `reinstall` [`--display-times`] <formula>: | 
					
						
							| 
									
										
										
										
											2017-12-30 21:23:33 +00:00
										 |  |  | #:    Uninstall and then install <formula> (with existing install options). | 
					
						
							| 
									
										
										
										
											2018-06-20 00:54:14 -04:00
										 |  |  | #: | 
					
						
							|  |  |  | #:    If `--display-times` is passed, install times for each formula are printed | 
					
						
							|  |  |  | #:    at the end of the run. | 
					
						
							| 
									
										
										
										
											2018-10-29 11:23:32 -04:00
										 |  |  | #: | 
					
						
							|  |  |  | #:    If `HOMEBREW_INSTALL_CLEANUP` is set then remove previously installed versions | 
					
						
							| 
									
										
										
										
											2018-10-30 10:19:45 -04:00
										 |  |  | #:    of upgraded <formulae> as well as the HOMEBREW_CACHE for that formula. | 
					
						
							| 
									
										
										
										
											2016-04-08 16:28:43 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-31 20:10:08 -05:00
										 |  |  | require "formula_installer" | 
					
						
							| 
									
										
										
										
											2016-07-29 20:31:32 -06:00
										 |  |  | require "development_tools" | 
					
						
							| 
									
										
										
										
											2018-06-20 02:10:54 -04:00
										 |  |  | require "messages" | 
					
						
							| 
									
										
										
										
											2018-09-12 19:28:02 +00:00
										 |  |  | require "reinstall" | 
					
						
							| 
									
										
										
										
											2018-11-07 22:17:36 +05:30
										 |  |  | require "cli_parser" | 
					
						
							| 
									
										
										
										
											2013-02-17 13:23:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-18 22:41:47 -05:00
										 |  |  | module Homebrew | 
					
						
							| 
									
										
										
										
											2016-09-26 01:44:51 +02:00
										 |  |  |   module_function | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-07 22:17:36 +05:30
										 |  |  |   def reinstall_args | 
					
						
							|  |  |  |     Homebrew::CLI::Parser.new do | 
					
						
							|  |  |  |       usage_banner <<~EOS | 
					
						
							|  |  |  |         `reinstall` [<option(s)>] <formula>: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         Uninstall and then install <formula> (with existing install options). | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         If `HOMEBREW_INSTALL_CLEANUP` is set then remove previously installed versions | 
					
						
							|  |  |  |         of upgraded <formulae> as well as the HOMEBREW_CACHE for that formula. | 
					
						
							|  |  |  |       EOS | 
					
						
							| 
									
										
										
										
											2018-11-24 15:36:59 +00:00
										 |  |  |       switch "-s", "--build-from-source", | 
					
						
							|  |  |  |         description: "Compile the formula> from source even if a bottle is available." | 
					
						
							| 
									
										
										
										
											2018-11-07 22:17:36 +05:30
										 |  |  |       switch "--display-times", | 
					
						
							|  |  |  |         description: "Print install times for each formula at the end of the run." | 
					
						
							| 
									
										
										
										
											2018-11-13 17:28:22 +05:30
										 |  |  |       switch :verbose | 
					
						
							| 
									
										
										
										
											2018-11-07 22:17:36 +05:30
										 |  |  |       switch :debug | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-17 13:23:41 +00:00
										 |  |  |   def reinstall | 
					
						
							| 
									
										
										
										
											2018-11-07 22:17:36 +05:30
										 |  |  |     reinstall_args.parse | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-06 11:07:24 +01:00
										 |  |  |     FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed? | 
					
						
							| 
									
										
										
										
											2015-06-29 14:09:57 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-06 18:38:43 +01:00
										 |  |  |     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 | 
					
						
							| 
									
										
										
										
											2017-03-29 11:25:27 +01:00
										 |  |  |       Migrator.migrate_if_needed(f) | 
					
						
							| 
									
										
										
										
											2016-09-05 22:40:08 +03:00
										 |  |  |       reinstall_formula(f) | 
					
						
							| 
									
										
										
										
											2018-10-29 11:23:32 -04:00
										 |  |  |       Cleanup.new.cleanup_formula(f) if ENV["HOMEBREW_INSTALL_CLEANUP"] | 
					
						
							| 
									
										
										
										
											2016-09-05 22:40:08 +03:00
										 |  |  |     end | 
					
						
							| 
									
										
										
										
											2018-06-20 02:10:54 -04:00
										 |  |  |     Homebrew.messages.display_messages | 
					
						
							| 
									
										
										
										
											2014-03-15 10:40:18 -05:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2013-02-17 13:23:41 +00:00
										 |  |  | end |