| 
									
										
										
										
											2021-09-11 01:00:23 +01:00
										 |  |  | # typed: strict | 
					
						
							| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-05 23:19:18 -04:00
										 |  |  | module Homebrew | 
					
						
							| 
									
										
										
										
											2020-08-17 04:53:36 +02:00
										 |  |  |   # @api private | 
					
						
							| 
									
										
										
										
											2018-06-05 23:19:18 -04:00
										 |  |  |   module Fetch | 
					
						
							| 
									
										
										
										
											2020-11-29 22:36:54 +01:00
										 |  |  |     extend T::Sig | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-10 23:46:07 +00:00
										 |  |  |     sig { params(formula: Formula, args: CLI::Args).returns(T::Boolean) } | 
					
						
							|  |  |  |     def fetch_bottle?(formula, args:) | 
					
						
							|  |  |  |       bottle = formula.bottle | 
					
						
							| 
									
										
										
										
											2020-11-29 22:36:54 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-07 13:49:05 -08:00
										 |  |  |       return true if args.force_bottle? && bottle.present? | 
					
						
							| 
									
										
										
										
											2023-03-10 23:46:07 +00:00
										 |  |  |       return true if args.bottle_tag.present? && formula.bottled?(args.bottle_tag) | 
					
						
							| 
									
										
										
										
											2018-09-17 02:45:00 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-07 13:49:05 -08:00
										 |  |  |       bottle.present? && | 
					
						
							| 
									
										
										
										
											2023-03-10 23:46:07 +00:00
										 |  |  |         formula.pour_bottle? && | 
					
						
							|  |  |  |         args.build_from_source_formulae.exclude?(formula.full_name) && | 
					
						
							| 
									
										
										
										
											2021-01-07 13:49:05 -08:00
										 |  |  |         bottle.compatible_locations? | 
					
						
							| 
									
										
										
										
											2018-06-05 23:19:18 -04:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |