File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 11require "formula"
2+ require "os/linux/glibc"
23
34class SystemConfig
45 class << self
@@ -14,6 +15,12 @@ def host_os_version
1415 end
1516 end
1617
18+ def host_glibc_version
19+ version = OS ::Linux ::Glibc . system_version
20+ return "N/A" if version . null?
21+ version
22+ end
23+
1724 def host_gcc_version
1825 gcc = Pathname . new "/usr/bin/gcc"
1926 return "N/A" unless gcc . executable?
@@ -31,6 +38,7 @@ def dump_verbose_config(out = $stdout)
3138 dump_generic_verbose_config ( out )
3239 out . puts "Kernel: #{ `uname -mors` . chomp } "
3340 out . puts "OS: #{ host_os_version } "
41+ out . puts "Host glibc: #{ host_glibc_version } "
3442 out . puts "/usr/bin/gcc: #{ host_gcc_version } "
3543 [ "glibc" , "gcc" , "xorg" ] . each do |f |
3644 out . puts "#{ f } : #{ formula_linked_version f } "
Original file line number Diff line number Diff line change 1+ module OS
2+ module Linux
3+ module Glibc
4+ module_function
5+
6+ def system_version
7+ return @system_version if @system_version
8+ version = Utils . popen_read ( "/usr/bin/ldd" , "--version" ) [ / (\d +\. \d +)/ , 1 ]
9+ return Version ::NULL unless version
10+ @system_version = Version . new version
11+ end
12+ end
13+ end
14+ end
You can’t perform that action at this time.
0 commit comments