formula: realpath prefix before computing abv
versioned prefix is a directory, but unversioned is a symlink, so realpath it before computing abv
This commit is contained in:
		
							parent
							
								
									98dadd907e
								
							
						
					
					
						commit
						6195d6592b
					
				| @ -553,7 +553,7 @@ class Formula | |||||||
|   # called from within the same formula's {#install} or {#post_install} methods. |   # called from within the same formula's {#install} or {#post_install} methods. | ||||||
|   # Otherwise, return the full path to the formula's versioned cellar. |   # Otherwise, return the full path to the formula's versioned cellar. | ||||||
|   def prefix(v = pkg_version) |   def prefix(v = pkg_version) | ||||||
|     prefix = rack/v |     prefix = FormulaPrefixPathname.new(rack/v) | ||||||
|     if !@versioned_prefix && prefix.directory? && Keg.new(prefix).optlinked? |     if !@versioned_prefix && prefix.directory? && Keg.new(prefix).optlinked? | ||||||
|       opt_prefix |       opt_prefix | ||||||
|     else |     else | ||||||
| @ -938,7 +938,7 @@ class Formula | |||||||
|   # formula, as the path is stable even when the software is updated. |   # formula, as the path is stable even when the software is updated. | ||||||
|   # <pre>args << "--with-readline=#{Formula["readline"].opt_prefix}" if build.with? "readline"</pre> |   # <pre>args << "--with-readline=#{Formula["readline"].opt_prefix}" if build.with? "readline"</pre> | ||||||
|   def opt_prefix |   def opt_prefix | ||||||
|     Pathname.new("#{HOMEBREW_PREFIX}/opt/#{name}") |     FormulaPrefixPathname.new("#{HOMEBREW_PREFIX}/opt/#{name}") | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|   def opt_bin |   def opt_bin | ||||||
| @ -2423,4 +2423,10 @@ class Formula | |||||||
|       @link_overwrite_paths ||= Set.new |       @link_overwrite_paths ||= Set.new | ||||||
|     end |     end | ||||||
|   end |   end | ||||||
|  | 
 | ||||||
|  |   class FormulaPrefixPathname < Pathname | ||||||
|  |     def abv | ||||||
|  |       Pathname.new(realpath).abv | ||||||
|  |     end | ||||||
|  |   end | ||||||
| end | end | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 ilovezfs
						ilovezfs