diff options
| author | Jack Nagel | 2012-01-11 02:02:32 -0600 |
|---|---|---|
| committer | Jack Nagel | 2012-01-11 02:19:09 -0600 |
| commit | f05db25a8e056e21142df07d4d7fe34e028ab0b1 (patch) | |
| tree | b71133eddcc54b2bd92d06f2d384e680d30e83f6 | |
| parent | e32e47c8687df4f5f1cc8cf94bc67e906fd580b5 (diff) | |
| download | homebrew-f05db25a8e056e21142df07d4d7fe34e028ab0b1.tar.bz2 | |
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 <jacknagel@gmail.com>
| -rw-r--r-- | Library/Homebrew/cmd/--config.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/--config.rb b/Library/Homebrew/cmd/--config.rb index 66b9ef756..e39842c5e 100644 --- a/Library/Homebrew/cmd/--config.rb +++ b/Library/Homebrew/cmd/--config.rb @@ -54,7 +54,7 @@ module Homebrew extend self GCC-4.0: #{gcc_40 ? "build #{gcc_40}" : "N/A"} GCC-4.2: #{gcc_42 ? "build #{gcc_42}" : "N/A"} LLVM: #{llvm ? "build #{llvm}" : "N/A"} - Clang: #{clang ? "#{clang}-#{clang_build}" : "N/A"} + Clang: #{clang ? "#{clang} build #{clang_build}" : "N/A"} MacPorts or Fink? #{macports_or_fink_installed?} X11 installed? #{x11_installed?} EOS 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 |
