From 0735eba995a1b35d14fbba8f41553d96b2fa14f7 Mon Sep 17 00:00:00 2001 From: Nanda H Krishna Date: Mon, 31 May 2021 16:48:20 +0530 Subject: [PATCH] formula_installer: improve support for local bottle installs --- Library/Homebrew/formula_installer.rb | 4 ++-- Library/Homebrew/tab.rb | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index dc7e1bee35..c76bfd1cb0 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -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) @@ -1163,7 +1163,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_revision"] = formula.tap&.installed? ? formula.tap&.git_head : nil tab.tap = formula.tap tab.write diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 7ce6b00c08..4725036189 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -39,11 +39,11 @@ class Tab < OpenStruct "runtime_dependencies" => Tab.runtime_deps_hash(formula, runtime_deps), "arch" => Hardware::CPU.arch, "source" => { - "path" => formula.specified_path.to_s, - "tap" => formula.tap&.name, - "tap_git_head" => formula.tap&.git_head, - "spec" => formula.active_spec_sym.to_s, - "versions" => { + "path" => formula.specified_path.to_s, + "tap" => formula.tap&.name, + "tap_git_revision" => formula.tap&.git_head, + "spec" => formula.active_spec_sym.to_s, + "versions" => { "stable" => formula.stable&.version.to_s, "head" => formula.head&.version.to_s, "version_scheme" => formula.version_scheme, @@ -194,11 +194,11 @@ class Tab < OpenStruct "runtime_dependencies" => nil, "arch" => nil, "source" => { - "path" => nil, - "tap" => nil, - "tap_git_head" => nil, - "spec" => "stable", - "versions" => { + "path" => nil, + "tap" => nil, + "tap_git_revision" => nil, + "spec" => "stable", + "versions" => { "stable" => nil, "head" => nil, "version_scheme" => 0,