diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 437b56f5a3..6e714d12ee 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -1593,7 +1593,7 @@ on_request: installed_on_request?, options:) keg = Keg.new(formula.prefix) skip_linkage = formula.bottle_specification.skip_relocation? - keg.replace_placeholders_with_locations(tab.changed_files&.map { Pathname(_1) }, skip_linkage:) + keg.replace_placeholders_with_locations(tab.changed_files, skip_linkage:) cellar = formula.bottle_specification.tag_to_cellar(Utils::Bottles.tag) return if [:any, :any_skip_relocation].include?(cellar) diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index d95edf2c30..1f5985b5f1 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -52,7 +52,14 @@ class AbstractTab @built_on = T.let(nil, T.nilable(T::Hash[String, T.untyped])) @runtime_dependencies = T.let(nil, T.nilable(T::Array[T.untyped])) - attributes.each { |key, value| instance_variable_set(:"@#{key}", value) } + attributes.each do |key, value| + case key.to_sym + when :changed_files + @changed_files = value&.map { |f| Pathname(f) } + else + instance_variable_set(:"@#{key}", value) + end + end end # Instantiates a {Tab} for a new installation of a formula or cask.