From 2d5f6dd79fc4b6c61ea889d0cf6fb66a4f8b5fde Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 11 Dec 2019 13:49:56 +0000 Subject: [PATCH] os/mac/xcode: improve CLT clang version detection. --- Library/Homebrew/os/mac/xcode.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index c102400003..f699ff3c26 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -280,6 +280,10 @@ module OS version_output[/clang-(\d+\.\d+\.\d+(\.\d+)?)/, 1] end + def detect_version_from_clang_version + detect_clang_version&.sub(/^(\d+)00\./, "\\1.") + end + # Version string (a pretty long one) of the CLT package. # Note, that different ways to install the CLTs lead to different # version numbers. @@ -300,7 +304,7 @@ module OS return version if version end - detect_clang_version + detect_version_from_clang_version end end end