diff options
| author | Jack Nagel | 2011-11-03 21:10:57 -0500 |
|---|---|---|
| committer | Jack Nagel | 2011-11-25 13:00:59 -0600 |
| commit | d07821350122fc12114812d9172bcb56b20e0089 (patch) | |
| tree | 7752bdd1fd37f77566a2b0dd123dfb0f15d47d68 /Library/Homebrew/utils.rb | |
| parent | ed55d2f4bb8135b1330107410b807656e8df2285 (diff) | |
| download | homebrew-d07821350122fc12114812d9172bcb56b20e0089.tar.bz2 | |
Parse `compiler --version` instead of -v
For GCC and LLVM-GCC, '-v' is not a synonym for --version. When run
without any other options or arguments, it gives similar output, but it
is better to just parse the (terser) --version output.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/utils.rb')
| -rw-r--r-- | Library/Homebrew/utils.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index dc7bf5d42..48068b9e1 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -261,7 +261,7 @@ module MacOS extend self end def gcc_42_build_version - `/usr/bin/gcc-4.2 -v 2>&1` =~ /build (\d{4,})/ + `/usr/bin/gcc-4.2 --version` =~ /build (\d{4,})/ if $1 $1.to_i elsif system "/usr/bin/which gcc" @@ -276,7 +276,7 @@ module MacOS extend self end def gcc_40_build_version - `/usr/bin/gcc-4.0 -v 2>&1` =~ /build (\d{4,})/ + `/usr/bin/gcc-4.0 --version` =~ /build (\d{4,})/ if $1 $1.to_i else @@ -335,7 +335,7 @@ module MacOS extend self # for Xcode 3 on OS X 10.5 this will not exist # NOTE may not be true anymore but we can't test @llvm_build_version ||= if File.exist? "/usr/bin/llvm-gcc" - `/usr/bin/llvm-gcc -v 2>&1` =~ /LLVM build (\d{4,})/ + `/usr/bin/llvm-gcc --version` =~ /LLVM build (\d{4,})/ $1.to_i end end |
