From: Doug Goldstein Subject: [raisin][PATCHv2] Handle unsupported distros with a prettier message Date: Wed, 11 Nov 2015 10:26:41 -0600 Message-ID: <1447259201-9390-1-git-send-email-cardoe@cardoe.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org, stefano.stabellini@eu.citrix.com Cc: Doug Goldstein List-Id: xen-devel@lists.xenproject.org Handle unknown distros by saying "unknown" instead of an empty string and for Gentoo users actually mention it. Signed-off-by: Doug Goldstein --- lib/common-functions.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/common-functions.sh b/lib/common-functions.sh index 27f6434..a0b8431 100644 --- a/lib/common-functions.sh +++ b/lib/common-functions.sh @@ -150,8 +150,16 @@ function get_distro() { sed -r 's/\"|\(|\)//g' | awk '{print $2}'` os_RELEASE=`awk '/VERSION_ID=/' /etc/os-release | sed 's/VERSION_ID=//' \ | sed 's/\"//g'` + elif [[ -f /etc/gentoo-release ]] + then + os_VENDOR="Gentoo" fi + if [[ -z $os_VENDOR ]] + then + os_VENDOR="unknown" + fi + # Simply distro version string case "$os_VENDOR" in "Debian"* | "Ubuntu"* | "LinuxMint"* ) -- 2.4.10