licence-forbidden: consider directly contain forbidden licenses
This commit is contained in:
		
							parent
							
								
									e9ff0fac43
								
							
						
					
					
						commit
						80887e649b
					
				| @ -346,13 +346,20 @@ end | ||||
| 
 | ||||
| def forbidden_license_check(f) | ||||
|   forbidden_licenses = ENV["HOMEBREW_FORBIDDEN_LICENSES"].split(" ") | ||||
| 
 | ||||
|   if forbidden_licenses.include? f.license | ||||
|     raise CannotInstallFormulaError , <<~EOS | ||||
|         #{f.name} has a forbidden license #{f.license}. | ||||
|     EOS | ||||
|   end | ||||
| 
 | ||||
|   fi = FormulaInstaller.new(f) | ||||
|   fi.compute_dependencies.each do |dep, _| | ||||
|     dep_f = dep.to_formula | ||||
|     next unless forbidden_licenses.include? dep_f.license | ||||
| 
 | ||||
|     raise CannotInstallFormulaError, <<~EOS | ||||
|       #The installation of {f.name} has a dependency on #{dep.name} with a forbidden license #{dep_f.license} | ||||
|       The installation of #{f.name} has a dependency on #{dep.name} with a forbidden license #{dep_f.license}. | ||||
|     EOS | ||||
|   end | ||||
| end | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 lionellloh
						lionellloh