Merge pull request #11468 from nandahkrishna/local-bottle-installs

formula_installer: improve support for local bottle installs
This commit is contained in:
Nanda H Krishna 2021-06-11 21:21:36 +05:30 committed by GitHub
commit dfee6a9fd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -404,7 +404,7 @@ class FormulaInstaller
options = display_options(formula).join(" ")
oh1 "Installing #{Formatter.identifier(formula.full_name)} #{options}".strip if show_header?
unless formula.tap&.private?
if formula.tap&.installed? && !formula.tap&.private?
action = "#{formula.full_name} #{options}".strip
Utils::Analytics.report_event("install", action)
@ -1074,9 +1074,14 @@ class FormulaInstaller
-I #{$LOAD_PATH.join(File::PATH_SEPARATOR)}
--
#{HOMEBREW_LIBRARY_PATH}/postinstall.rb
#{formula.path}
]
args << if formula.local_bottle_path.present?
formula.prefix/".brew/#{formula.name}.rb"
else
formula.path
end
Utils.safe_fork do
if Sandbox.available?
sandbox = Sandbox.new
@ -1163,7 +1168,7 @@ class FormulaInstaller
tab.source["versions"]["stable"] = formula.stable.version.to_s
tab.source["versions"]["version_scheme"] = formula.version_scheme
tab.source["path"] = formula.specified_path.to_s
tab.source["tap_git_head"] = formula.tap&.git_head
tab.source["tap_git_head"] = formula.tap&.installed? ? formula.tap&.git_head : nil
tab.tap = formula.tap
tab.write