From 58be76bc9d8e19c057be7d171a5e1956ed2ffaa0 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sun, 31 Jul 2022 20:42:32 -0400 Subject: [PATCH] Fix `on_{system}` handling of generic macOS versions --- Library/Homebrew/extend/on_system.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/on_system.rb b/Library/Homebrew/extend/on_system.rb index 6b3ec69ecc..1a2cf7598b 100644 --- a/Library/Homebrew/extend/on_system.rb +++ b/Library/Homebrew/extend/on_system.rb @@ -31,7 +31,11 @@ module OnSystem return false if Homebrew::SimulateSystem.simulating_or_running_on_linux? base_os = MacOS::Version.from_symbol(os_name) - current_os = MacOS::Version.from_symbol(Homebrew::SimulateSystem.current_os) + current_os = if Homebrew::SimulateSystem.current_os == :macos + Version::NULL + else + MacOS::Version.from_symbol(Homebrew::SimulateSystem.current_os) + end return current_os >= base_os if or_condition == :or_newer return current_os <= base_os if or_condition == :or_older