From 2064b30fceb8d9e3fe025331919b8feebf33ff7f Mon Sep 17 00:00:00 2001 From: follower Date: Wed, 24 Apr 2019 15:02:13 +1200 Subject: [PATCH 1/2] Fix check_for_unsupported_macos() on outdated releases Recent commit https://github.com/Homebrew/brew/commit/36dbad3922ad984f7c396a9757fe8ae9750c44b0 to default to frozen string literals (via `frozen_string_literal`) broke `check_for_unsupported_macos()` on outdated releases--due to attempted modification of a frozen string literal. This breaks `install` and `doctor`. It's like the change wasn't tested on an unsupported outdated release or something... :D Adding a `+` prefix is apparently one way around this issue according to https://stackoverflow.com/questions/37799296/what-does-the-comment-frozen-string-literal-true-do#37799399. The change worked for me. --- Library/Homebrew/extend/os/mac/diagnostic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index ae16cf5624..53cf3cd724 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -51,7 +51,7 @@ module Homebrew if OS::Mac.prerelease? what = "pre-release version" elsif OS::Mac.outdated_release? - who << " (and Apple)" + +who << " (and Apple)" what = "old version" else return From bc3a4c18978ea3b8e85a0d5999913984fdd62544 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 23 Apr 2019 23:05:28 -0700 Subject: [PATCH 2/2] diagnostic: tweak frozen string handling. --- Library/Homebrew/extend/os/mac/diagnostic.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 53cf3cd724..696c48db04 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -47,15 +47,16 @@ module Homebrew def check_for_unsupported_macos return if ARGV.homebrew_developer? - who = "We" + who = +"We" if OS::Mac.prerelease? what = "pre-release version" elsif OS::Mac.outdated_release? - +who << " (and Apple)" + who << " (and Apple)" what = "old version" else return end + who.freeze <<~EOS You are using macOS #{MacOS.version}.