mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
system_config: fix clang version output on Linux
If you have Homebrew LLVM installed, `brew config` will show Clang: 12.0.1 build (parse error) because Homebrew LLVM does not give a build number. Some installations from the system package manager do have this information, so let's show it if it's available but skip complaining if not. I've kept the original code for macOS because we always expect Apple's build number to show there.
This commit is contained in:
parent
4d5af40662
commit
25fe428ed2
@ -7,7 +7,7 @@ module SystemConfig
|
||||
class << self
|
||||
include SystemCommand::Mixin
|
||||
|
||||
undef describe_homebrew_ruby
|
||||
undef describe_homebrew_ruby, describe_clang
|
||||
|
||||
def describe_homebrew_ruby
|
||||
s = describe_homebrew_ruby_version
|
||||
@ -19,6 +19,13 @@ module SystemConfig
|
||||
end
|
||||
end
|
||||
|
||||
def describe_clang
|
||||
return "N/A" if clang.null?
|
||||
|
||||
clang_build_info = clang_build.null? ? "(parse error)" : clang_build
|
||||
"#{clang} build #{clang_build_info}"
|
||||
end
|
||||
|
||||
def xcode
|
||||
@xcode ||= if MacOS::Xcode.installed?
|
||||
xcode = MacOS::Xcode.version.to_s
|
||||
|
@ -76,8 +76,11 @@ module SystemConfig
|
||||
def describe_clang
|
||||
return "N/A" if clang.null?
|
||||
|
||||
clang_build_info = clang_build.null? ? "(parse error)" : clang_build
|
||||
"#{clang} build #{clang_build_info}"
|
||||
if clang_build.null?
|
||||
clang.to_s
|
||||
else
|
||||
"#{clang} build #{clang_build}"
|
||||
end
|
||||
end
|
||||
|
||||
def describe_path(path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user