Commit bd405791 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #3603 from axilleas/os-name

Added os_name support for systems running systemd.
parents 0f758405 efe90876
...@@ -16,7 +16,7 @@ namespace :gitlab do ...@@ -16,7 +16,7 @@ namespace :gitlab do
# Check which OS is running # Check which OS is running
# #
# It will primarily use lsb_relase to determine the OS. # It will primarily use lsb_relase to determine the OS.
# It has fallbacks to Debian, SuSE and OS X. # It has fallbacks to Debian, SuSE, OS X and systems running systemd.
def os_name def os_name
os_name = run("lsb_release -irs") os_name = run("lsb_release -irs")
os_name ||= if File.readable?('/etc/system-release') os_name ||= if File.readable?('/etc/system-release')
...@@ -32,6 +32,9 @@ namespace :gitlab do ...@@ -32,6 +32,9 @@ namespace :gitlab do
os_name ||= if os_x_version = run("sw_vers -productVersion") os_name ||= if os_x_version = run("sw_vers -productVersion")
"Mac OS X #{os_x_version}" "Mac OS X #{os_x_version}"
end end
os_name ||= if File.readable?('/etc/os-release')
File.read('/etc/os-release').match(/PRETTY_NAME=\"(.+)\"/)[1]
end
os_name.try(:squish!) os_name.try(:squish!)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment