From 94fef691c7b1f3028270e25b98e336349effb5eb Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 21 Jul 2011 16:17:09 +0200 Subject: [PATCH] bug #743: correctly detects missing lsb_release --- share/install_gems/install_gems | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/share/install_gems/install_gems b/share/install_gems/install_gems index f153b5cd61..8320bb7815 100755 --- a/share/install_gems/install_gems +++ b/share/install_gems/install_gems @@ -105,9 +105,17 @@ def get_gems(packages) end def detect_distro - lsb_info=`lsb_release -a` - if $?!=0 && false - STDERR.puts("lsb_release command not found") + begin + lsb_info=`lsb_release -a` + rescue + end + + if $?.exitstatus!=0 + STDERR.puts(<<-EOT.unindent(12)) + lsb_release command not found. If you are using a RedHat based + distribution install redhat-lsb + +EOT return nil end