From 3c8dd3e4df55e624845e74766bac7af149888b3d Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 25 Dec 2014 03:51:30 +0000 Subject: [PATCH] Handle missing `lsb_release` The lsb-release package isn't a stated dependency and isn't present on a minimal Debian install. --- debian/util.sh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/debian/util.sh b/debian/util.sh index f024a8c9c0..052762b91c 100755 --- a/debian/util.sh +++ b/debian/util.sh @@ -386,18 +386,23 @@ build_all () { shift $(($OPTIND-1)) [ -n "$archs" ] || archs="amd64 i386" if [ -z "$distros" ]; then - case "$(lsb_release -is)" in - Debian) - distros="sid jessie wheezy" - ;; - Ubuntu) - distros="utopic trusty" - ;; - *) - echo "Unknown distribution" - exit -1 - ;; - esac + local default_distros="sid jessie wheezy" + if [ -z "$(which lsb_release)" ]; then + distros="$default_distros" + else + case "$(lsb_release -is)" in + Debian) + distros="$default_distros" + ;; + Ubuntu) + distros="utopic trusty" + ;; + *) + echo "Unknown distribution" + exit -1 + ;; + esac + fi fi ! $depinst || aptitude install -y \ rsync git less cowbuilder ccache \