From: Stefano Stabellini Subject: Re: [raisin][PATCH 1/3] Handle unsupported distros with a prettier message Date: Fri, 11 Sep 2015 15:56:03 +0100 Message-ID: References: <1441811306-14934-1-git-send-email-cardoe@cardoe.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1441811306-14934-1-git-send-email-cardoe@cardoe.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Doug Goldstein Cc: stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 9 Sep 2015, Doug Goldstein wrote: > 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 | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/common-functions.sh b/lib/common-functions.sh > index c52174a..e96b105 100644 > --- a/lib/common-functions.sh > +++ b/lib/common-functions.sh > @@ -150,6 +150,9 @@ 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 > > # Simply distro version string > @@ -175,6 +178,7 @@ function get_distro() { > PKGTYPE="rpm" > ;; > *) > + [ -z $os_VENDOR ] && os_VENDOR="unknown" > DISTRO=$os_VENDOR > PKGTYPE="unknown" > ;; Thanks again for the patch. For consistency with the code style, could you please turn this into: if [[ -z $os_VENDOR ]] then os_VENDOR="unknown" fi You could also move it above the case.