Merge pull request #1782 from ilovezfs/prefix-fixups
Fix abv and prefix_linked?
This commit is contained in:
commit
1a394aa7e5
@ -26,11 +26,17 @@ module DiskUsageExtension
|
|||||||
private
|
private
|
||||||
|
|
||||||
def compute_disk_usage
|
def compute_disk_usage
|
||||||
if directory?
|
path = if symlink?
|
||||||
|
resolved_path
|
||||||
|
else
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
if path.directory?
|
||||||
scanned_files = Set.new
|
scanned_files = Set.new
|
||||||
@file_count = 0
|
@file_count = 0
|
||||||
@disk_usage = 0
|
@disk_usage = 0
|
||||||
find do |f|
|
path.find do |f|
|
||||||
if f.directory?
|
if f.directory?
|
||||||
@disk_usage += f.lstat.size
|
@disk_usage += f.lstat.size
|
||||||
else
|
else
|
||||||
@ -47,7 +53,7 @@ module DiskUsageExtension
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
@file_count = 1
|
@file_count = 1
|
||||||
@disk_usage = lstat.size
|
@disk_usage = path.lstat.size
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -198,7 +198,7 @@ class Formula
|
|||||||
@build = active_spec.build
|
@build = active_spec.build
|
||||||
@pin = FormulaPin.new(self)
|
@pin = FormulaPin.new(self)
|
||||||
@follow_installed_alias = true
|
@follow_installed_alias = true
|
||||||
@versioned_prefix = false
|
@prefix_returns_versioned_prefix = false
|
||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
@ -553,11 +553,12 @@ 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
|
versioned_prefix = versioned_prefix(v)
|
||||||
if !@versioned_prefix && prefix.directory? && Keg.new(prefix).optlinked?
|
if !@prefix_returns_versioned_prefix && v == pkg_version &&
|
||||||
|
versioned_prefix.directory? && Keg.new(versioned_prefix).optlinked?
|
||||||
opt_prefix
|
opt_prefix
|
||||||
else
|
else
|
||||||
prefix
|
versioned_prefix
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -574,7 +575,7 @@ class Formula
|
|||||||
# Is formula's linked keg points to the prefix.
|
# Is formula's linked keg points to the prefix.
|
||||||
def prefix_linked?(v = pkg_version)
|
def prefix_linked?(v = pkg_version)
|
||||||
return false unless linked?
|
return false unless linked?
|
||||||
linked_keg.resolved_path == prefix(v)
|
linked_keg.resolved_path == versioned_prefix(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
# {PkgVersion} of the linked keg for the formula.
|
# {PkgVersion} of the linked keg for the formula.
|
||||||
@ -1002,7 +1003,7 @@ class Formula
|
|||||||
|
|
||||||
# @private
|
# @private
|
||||||
def run_post_install
|
def run_post_install
|
||||||
@versioned_prefix = true
|
@prefix_returns_versioned_prefix = true
|
||||||
build = self.build
|
build = self.build
|
||||||
self.build = Tab.for_formula(self)
|
self.build = Tab.for_formula(self)
|
||||||
old_tmpdir = ENV["TMPDIR"]
|
old_tmpdir = ENV["TMPDIR"]
|
||||||
@ -1017,7 +1018,7 @@ class Formula
|
|||||||
ENV["TMPDIR"] = old_tmpdir
|
ENV["TMPDIR"] = old_tmpdir
|
||||||
ENV["TEMP"] = old_temp
|
ENV["TEMP"] = old_temp
|
||||||
ENV["TMP"] = old_tmp
|
ENV["TMP"] = old_tmp
|
||||||
@versioned_prefix = false
|
@prefix_returns_versioned_prefix = false
|
||||||
end
|
end
|
||||||
|
|
||||||
# Tell the user about any caveats regarding this package.
|
# Tell the user about any caveats regarding this package.
|
||||||
@ -1120,7 +1121,7 @@ class Formula
|
|||||||
# where staging is a Mktemp staging context
|
# where staging is a Mktemp staging context
|
||||||
# @private
|
# @private
|
||||||
def brew
|
def brew
|
||||||
@versioned_prefix = true
|
@prefix_returns_versioned_prefix = true
|
||||||
stage do |staging|
|
stage do |staging|
|
||||||
staging.retain! if ARGV.keep_tmp?
|
staging.retain! if ARGV.keep_tmp?
|
||||||
prepare_patches
|
prepare_patches
|
||||||
@ -1135,7 +1136,7 @@ class Formula
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
@versioned_prefix = false
|
@prefix_returns_versioned_prefix = false
|
||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
@ -1637,7 +1638,7 @@ class Formula
|
|||||||
|
|
||||||
# @private
|
# @private
|
||||||
def run_test
|
def run_test
|
||||||
@versioned_prefix = true
|
@prefix_returns_versioned_prefix = true
|
||||||
old_home = ENV["HOME"]
|
old_home = ENV["HOME"]
|
||||||
old_curl_home = ENV["CURL_HOME"]
|
old_curl_home = ENV["CURL_HOME"]
|
||||||
old_tmpdir = ENV["TMPDIR"]
|
old_tmpdir = ENV["TMPDIR"]
|
||||||
@ -1669,7 +1670,7 @@ class Formula
|
|||||||
ENV["TEMP"] = old_temp
|
ENV["TEMP"] = old_temp
|
||||||
ENV["TMP"] = old_tmp
|
ENV["TMP"] = old_tmp
|
||||||
ENV["TERM"] = old_term
|
ENV["TERM"] = old_term
|
||||||
@versioned_prefix = false
|
@prefix_returns_versioned_prefix = false
|
||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
@ -1854,6 +1855,12 @@ class Formula
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
# Returns the prefix for a given formula version number.
|
||||||
|
# @private
|
||||||
|
def versioned_prefix(v)
|
||||||
|
rack/v
|
||||||
|
end
|
||||||
|
|
||||||
def exec_cmd(cmd, args, out, logfn)
|
def exec_cmd(cmd, args, out, logfn)
|
||||||
ENV["HOMEBREW_CC_LOG_PATH"] = logfn
|
ENV["HOMEBREW_CC_LOG_PATH"] = logfn
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user