Be explicit about passing formulae names or instances to Tab
This commit is contained in:
		
							parent
							
								
									5627ed21ce
								
							
						
					
					
						commit
						1cd3149677
					
				@ -974,7 +974,7 @@ def check_for_non_prefixed_coreutils
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def check_for_non_prefixed_findutils
 | 
					def check_for_non_prefixed_findutils
 | 
				
			||||||
  default_names = Tab.for_formula('findutils').used_options.include? 'default-names'
 | 
					  default_names = Tab.for_name('findutils').used_options.include? 'default-names'
 | 
				
			||||||
  if default_names then <<-EOS.undent
 | 
					  if default_names then <<-EOS.undent
 | 
				
			||||||
    Putting non-prefixed findutils in your path can cause python builds to fail.
 | 
					    Putting non-prefixed findutils in your path can cause python builds to fail.
 | 
				
			||||||
    EOS
 | 
					    EOS
 | 
				
			||||||
 | 
				
			|||||||
@ -205,7 +205,7 @@ class FormulaInstaller
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def install_dependency dep
 | 
					  def install_dependency dep
 | 
				
			||||||
    dep_tab = Tab.for_formula(dep)
 | 
					    dep_tab = Tab.for_formula(dep.to_formula)
 | 
				
			||||||
    dep_options = dep.options
 | 
					    dep_options = dep.options
 | 
				
			||||||
    dep = dep.to_formula
 | 
					    dep = dep.to_formula
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -42,8 +42,11 @@ class Tab < OpenStruct
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def self.for_name name
 | 
				
			||||||
 | 
					    for_formula(Formula.factory(name))
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def self.for_formula f
 | 
					  def self.for_formula f
 | 
				
			||||||
    f = Formula.factory(f)
 | 
					 | 
				
			||||||
    path = [f.opt_prefix, f.linked_keg].map{ |pn| pn.join(FILENAME) }.find{ |pn| pn.exist? }
 | 
					    path = [f.opt_prefix, f.linked_keg].map{ |pn| pn.join(FILENAME) }.find{ |pn| pn.exist? }
 | 
				
			||||||
    # Legacy kegs may lack a receipt. If it doesn't exist, fake one
 | 
					    # Legacy kegs may lack a receipt. If it doesn't exist, fake one
 | 
				
			||||||
    if path.nil? then self.dummy_tab(f) else self.from_file(path) end
 | 
					    if path.nil? then self.dummy_tab(f) else self.from_file(path) end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user