Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
0d5a53ba
Commit
0d5a53ba
authored
8 years ago
by
Shaun Jackman
Browse files
Options
Downloads
Patches
Plain Diff
Add extend/os/linux/system_config.rb
Report the Linux kernel, OS, and gcc versions.
parent
bfb5bf1d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/extend/os/linux/system_config.rb
+42
-0
42 additions, 0 deletions
Library/Homebrew/extend/os/linux/system_config.rb
Library/Homebrew/extend/os/system_config.rb
+6
-1
6 additions, 1 deletion
Library/Homebrew/extend/os/system_config.rb
with
48 additions
and
1 deletion
Library/Homebrew/extend/os/linux/system_config.rb
0 → 100644
+
42
−
0
View file @
0d5a53ba
require
"formula"
class
SystemConfig
class
<<
self
def
host_os_version
if
which
(
"lsb_release"
)
description
=
`lsb_release -d`
.
chomp
.
sub
(
"Description:
\t
"
,
""
)
codename
=
`lsb_release -c`
.
chomp
.
sub
(
"Codename:
\t
"
,
""
)
"
#{
description
}
(
#{
codename
}
)"
elsif
(
redhat_release
=
Pathname
.
new
(
"/etc/redhat-release"
)).
readable?
redhat_release
.
read
.
chomp
else
"N/A"
end
end
def
host_gcc_version
gcc
=
Pathname
.
new
"/usr/bin/gcc"
return
"N/A"
unless
gcc
.
executable?
`
#{
gcc
}
--version 2>/dev/null`
[
/ (\d+\.\d+\.\d+)/
,
1
]
end
def
formula_version
(
formula
)
return
"N/A"
unless
CoreTap
.
instance
.
installed?
f
=
Formulary
.
factory
formula
return
"N/A"
unless
f
.
installed?
f
.
version
rescue
FormulaUnavailableError
return
"N/A"
end
def
dump_verbose_config
(
out
=
$stdout
)
dump_generic_verbose_config
(
out
)
out
.
puts
"Kernel:
#{
`uname -mors`
.
chomp
}
"
out
.
puts
"OS:
#{
host_os_version
}
"
out
.
puts
"/usr/bin/gcc:
#{
host_gcc_version
}
"
[
"glibc"
,
"gcc"
,
"xorg"
].
each
do
|
f
|
out
.
puts
"
#{
f
}
:
#{
formula_version
f
}
"
end
end
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/extend/os/system_config.rb
+
6
−
1
View file @
0d5a53ba
require
"system_config"
require
"extend/os/mac/system_config"
if
OS
.
mac?
if
OS
.
mac?
require
"extend/os/mac/system_config"
elsif
OS
.
linux?
require
"extend/os/linux/system_config"
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment