software_spec.rb: change compatible_location
This commit is contained in:
		
							parent
							
								
									bff8c9aca8
								
							
						
					
					
						commit
						70bc181029
					
				@ -473,6 +473,8 @@ class Bottle
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
class BottleSpecification
 | 
			
		||||
  RELOCATABLE_CELLARS = [:any, :any_skip_relocation].freeze
 | 
			
		||||
 | 
			
		||||
  extend T::Sig
 | 
			
		||||
 | 
			
		||||
  attr_rw :rebuild
 | 
			
		||||
@ -518,12 +520,15 @@ class BottleSpecification
 | 
			
		||||
  def compatible_locations?(tag: Utils::Bottles.tag)
 | 
			
		||||
    cellar = tag_to_cellar(tag)
 | 
			
		||||
 | 
			
		||||
    return true if [:any, :any_skip_relocation].include?(cellar)
 | 
			
		||||
    return true if RELOCATABLE_CELLARS.include?(cellar)
 | 
			
		||||
 | 
			
		||||
    prefix = Pathname(cellar).parent.to_s
 | 
			
		||||
 | 
			
		||||
    compatible_cellar = cellar == HOMEBREW_CELLAR.to_s
 | 
			
		||||
    compatible_prefix = prefix == HOMEBREW_PREFIX.to_s
 | 
			
		||||
    cellar_relocatable = cellar.size >= HOMEBREW_CELLAR.to_s.size && ENV["HOMEBREW_RELOCATE_BUILD_PREFIX"]
 | 
			
		||||
    prefix_relocatable = prefix.size >= HOMEBREW_PREFIX.to_s.size && ENV["HOMEBREW_RELOCATE_BUILD_PREFIX"]
 | 
			
		||||
 | 
			
		||||
    compatible_cellar = cellar == HOMEBREW_CELLAR.to_s || cellar_relocatable
 | 
			
		||||
    compatible_prefix = prefix == HOMEBREW_PREFIX.to_s || prefix_relocatable
 | 
			
		||||
 | 
			
		||||
    compatible_cellar && compatible_prefix
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user