mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
formula_installer: minor refactoring
This commit is contained in:
parent
b9d64fed4d
commit
c70bcd53f7
@ -1076,9 +1076,6 @@ class FormulaInstaller
|
|||||||
#{HOMEBREW_LIBRARY_PATH}/postinstall.rb
|
#{HOMEBREW_LIBRARY_PATH}/postinstall.rb
|
||||||
]
|
]
|
||||||
|
|
||||||
keg_formula_path = formula.opt_prefix/".brew/#{formula.name}.rb"
|
|
||||||
tap_formula_path = formula.path
|
|
||||||
|
|
||||||
# Use the formula from the keg if:
|
# Use the formula from the keg if:
|
||||||
# * Installing from a local bottle, or
|
# * Installing from a local bottle, or
|
||||||
# * The formula doesn't exist in the tap (or the tap isn't installed), or
|
# * The formula doesn't exist in the tap (or the tap isn't installed), or
|
||||||
@ -1086,7 +1083,9 @@ class FormulaInstaller
|
|||||||
# In all other cases, including if the formula from the keg is unreadable
|
# In all other cases, including if the formula from the keg is unreadable
|
||||||
# (third-party taps may `require` some of their own libraries), use the
|
# (third-party taps may `require` some of their own libraries), use the
|
||||||
# formula from the tap.
|
# formula from the tap.
|
||||||
args << begin
|
formula_path = begin
|
||||||
|
keg_formula_path = formula.opt_prefix/".brew/#{formula.name}.rb"
|
||||||
|
tap_formula_path = formula.path
|
||||||
keg_formula = Formulary.factory(keg_formula_path)
|
keg_formula = Formulary.factory(keg_formula_path)
|
||||||
tap_formula = Formulary.factory(tap_formula_path) if tap_formula_path.exist?
|
tap_formula = Formulary.factory(tap_formula_path) if tap_formula_path.exist?
|
||||||
other_version_installed = (keg_formula.pkg_version != tap_formula&.pkg_version)
|
other_version_installed = (keg_formula.pkg_version != tap_formula&.pkg_version)
|
||||||
@ -1102,6 +1101,8 @@ class FormulaInstaller
|
|||||||
tap_formula_path
|
tap_formula_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
args << formula_path
|
||||||
|
|
||||||
Utils.safe_fork do
|
Utils.safe_fork do
|
||||||
if Sandbox.available?
|
if Sandbox.available?
|
||||||
sandbox = Sandbox.new
|
sandbox = Sandbox.new
|
||||||
|
Loading…
x
Reference in New Issue
Block a user