From c806d4cf607545d38c0430a8ffb5bffb2c0c1ab1 Mon Sep 17 00:00:00 2001 From: Nils Steinger Date: Thu, 24 Sep 2015 01:35:55 +0200 Subject: [PATCH] distro script: Consider /etc/os-release along with the distribution-specific files and allow /etc/lsb-release to override it --- scripts/distro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/distro b/scripts/distro index a60e277b81..88cfd80a7a 100755 --- a/scripts/distro +++ b/scripts/distro @@ -43,6 +43,9 @@ elif [ "${OS}" = "Linux" ] ; then IGNORE_LSB=1 # /etc/lsb-release would overwrite $REV with "rolling" elif [ -f /etc/UnitedLinux-release ] ; then DIST="${DIST}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]" + elif [ -f /etc/os-release ] ; then + DIST="$(grep '^NAME=' /etc/os-release | cut -d= -f2- | tr -d '\"')" + REV="$(grep '^VERSION_ID=' /etc/os-release | cut -d= -f2- | tr -d '\"')" fi if [ -f /etc/lsb-release -a "${IGNORE_LSB}" != 1 ] ; then @@ -52,9 +55,6 @@ elif [ "${OS}" = "Linux" ] ; then DIST=$LSB_DIST REV=$LSB_REV fi - elif [ -f /etc/os-release ] ; then - DIST="$(grep '^NAME=' /etc/os-release | cut -d= -f2- | tr -d '\"')" - REV="$(grep '^VERSION_ID=' /etc/os-release | cut -d= -f2- | tr -d '\"')" fi if [ -n "${REV}" ]