From f05db25a8e056e21142df07d4d7fe34e028ab0b1 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 11 Jan 2012 02:02:32 -0600 Subject: Make MacOS.clang_build_version more useful Let's choose the first \d{2,} as the build number, as it is the most likely to indicate significant changes, and we need something to use for comparison when selecting compilers. Signed-off-by: Jack Nagel --- Library/Homebrew/utils.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Library/Homebrew/utils.rb') diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 71317a8ef..97fa46f7b 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -343,8 +343,8 @@ module MacOS extend self def clang_build_version @clang_build_version ||= if File.exist? "/usr/bin/clang" - `/usr/bin/clang --version` =~ %r[tags/Apple/clang-(\d+(\.\d+)*)] - $1 + `/usr/bin/clang --version` =~ %r[tags/Apple/clang-(\d{2,})] + $1.to_i end end -- cgit v1.2.3