Commit 406d745f authored by Mislav Marohnić's avatar Mislav Marohnić
Browse files

Peruse `/etc/os-release` among others when detecting system info

On Fedora, this results in a nice "Fedora 19" identifier and doesn't
show the codename "Schrödinger’s Cat" which is otherwise contained in
`/etc/fedora-release`.

On Arch, this shows "Arch Linux" where previously we had no info for it
(for some reason, `/etc/arch-release` is empty).

http://www.freedesktop.org/software/systemd/man/os-release.html
parent b275e87c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -76,6 +76,9 @@ os_information() {
    lsb_release -sir | xargs echo
  elif type -p sw_vers >/dev/null; then
    echo "OS X $(sw_vers -productVersion)"
  elif [ -r /etc/os-release ]; then
    source /etc/os-release
    echo "$NAME" $VERSION_ID
  else
    local os="$(cat /etc/{centos,redhat,fedora,system}-release /etc/debian_version 2>/dev/null | head -1)"
    echo "${os:-$(uname -sr)}"