From 3c0506e2760ef82f769871eb46eb01db8fa72fde Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sun, 5 Nov 2023 12:23:42 -0800 Subject: [PATCH] Fix tag_to_cellar --- Library/Homebrew/software_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 4af61b3d72..c1042875c9 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -541,11 +541,11 @@ class BottleSpecification end alias eql? == - sig { params(tag: Utils::Bottles::Tag).returns(String) } + sig { params(tag: Utils::Bottles::Tag).returns(T.any(Symbol, String)) } def tag_to_cellar(tag = Utils::Bottles.tag) spec = collector.specification_for(tag) if spec.present? - spec.cellar.to_s + spec.cellar else tag.default_cellar end @@ -557,7 +557,7 @@ class BottleSpecification return true if RELOCATABLE_CELLARS.include?(cellar) - prefix = Pathname(cellar).parent.to_s + prefix = Pathname(cellar.to_s).parent.to_s cellar_relocatable = cellar.size >= HOMEBREW_CELLAR.to_s.size && ENV["HOMEBREW_RELOCATE_BUILD_PREFIX"].present? prefix_relocatable = prefix.size >= HOMEBREW_PREFIX.to_s.size && ENV["HOMEBREW_RELOCATE_BUILD_PREFIX"].present?