diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-18 03:08:40 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-18 03:08:40 -0700 |
commit | bd4057910b117b8b44fd45b771ffd67316421ea9 (patch) | |
tree | 4d734bcbaf037baff1ca049940a8ebc986bb4765 | |
parent | 0f758405e0ab12c16b64bc76664537f0474ba84a (diff) | |
parent | efe90876062b3ca0f645baa7091d865c759c4da2 (diff) | |
download | gitlab-ce-bd4057910b117b8b44fd45b771ffd67316421ea9.tar.gz |
Merge pull request #3603 from axilleas/os-name
Added os_name support for systems running systemd.
-rw-r--r-- | lib/tasks/gitlab/task_helpers.rake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/task_helpers.rake b/lib/tasks/gitlab/task_helpers.rake index cfab3670fb2..34a4a322c11 100644 --- a/lib/tasks/gitlab/task_helpers.rake +++ b/lib/tasks/gitlab/task_helpers.rake @@ -16,7 +16,7 @@ namespace :gitlab do # Check which OS is running # # 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 os_name = run("lsb_release -irs") os_name ||= if File.readable?('/etc/system-release') @@ -32,6 +32,9 @@ namespace :gitlab do os_name ||= if os_x_version = run("sw_vers -productVersion") "Mac OS X #{os_x_version}" end + os_name ||= if File.readable?('/etc/os-release') + File.read('/etc/os-release').match(/PRETTY_NAME=\"(.+)\"/)[1] + end os_name.try(:squish!) end |