Don't error out when a package is already installed
Fixes Homebrew/homebrew#17010.
This commit is contained in:
		
							parent
							
								
									d25b4e40c1
								
							
						
					
					
						commit
						12932a51b3
					
				@ -91,6 +91,8 @@ module Homebrew extend self
 | 
			
		||||
  rescue FormulaInstallationAlreadyAttemptedError
 | 
			
		||||
    # We already attempted to install f as part of the dependency tree of
 | 
			
		||||
    # another formula. In that case, don't generate an error, just move on.
 | 
			
		||||
  rescue FormulaAlreadyInstalledError => e
 | 
			
		||||
    opoo e.message
 | 
			
		||||
  rescue CannotInstallFormulaError => e
 | 
			
		||||
    ofail e.message
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
@ -71,6 +71,9 @@ end
 | 
			
		||||
class CannotInstallFormulaError < RuntimeError
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
class FormulaAlreadyInstalledError < RuntimeError
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
class FormulaInstallationAlreadyAttemptedError < Homebrew::InstallationError
 | 
			
		||||
  def message
 | 
			
		||||
    "Formula installation already attempted: #{formula}"
 | 
			
		||||
 | 
			
		||||
@ -34,7 +34,7 @@ class FormulaInstaller
 | 
			
		||||
    if f.installed?
 | 
			
		||||
      msg = "#{f}-#{f.installed_version} already installed"
 | 
			
		||||
      msg << ", it's just not linked" if not f.linked_keg.symlink? and not f.keg_only?
 | 
			
		||||
      raise CannotInstallFormulaError, msg
 | 
			
		||||
      raise FormulaAlreadyInstalledError, msg
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    # Building head-only without --HEAD is an error
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user