diff options
| author | ilovezfs | 2017-01-04 10:23:15 -0800 |
|---|---|---|
| committer | ilovezfs | 2017-01-04 10:23:15 -0800 |
| commit | 6195d6592b7374e135440025c82ae19cf37f30af (patch) | |
| tree | b1fd62f959d3008dea9f34c30b6822528ac010fa /Library | |
| parent | 98dadd907e31bb5f9a16bfb6aa2138b1852c4db5 (diff) | |
| download | brew-6195d6592b7374e135440025c82ae19cf37f30af.tar.bz2 | |
formula: realpath prefix before computing abv
versioned prefix is a directory, but unversioned is a symlink, so
realpath it before computing abv
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index eb85f804f..dcee0de85 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -553,7 +553,7 @@ class Formula # called from within the same formula's {#install} or {#post_install} methods. # Otherwise, return the full path to the formula's versioned cellar. def prefix(v = pkg_version) - prefix = rack/v + prefix = FormulaPrefixPathname.new(rack/v) if !@versioned_prefix && prefix.directory? && Keg.new(prefix).optlinked? opt_prefix else @@ -938,7 +938,7 @@ class Formula # 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> def opt_prefix - Pathname.new("#{HOMEBREW_PREFIX}/opt/#{name}") + FormulaPrefixPathname.new("#{HOMEBREW_PREFIX}/opt/#{name}") end def opt_bin @@ -2423,4 +2423,10 @@ class Formula @link_overwrite_paths ||= Set.new end end + + class FormulaPrefixPathname < Pathname + def abv + Pathname.new(realpath).abv + end + end end |
