Handle missing `lsb_release`

The lsb-release package isn't a stated dependency and isn't present on
a minimal Debian install.
This commit is contained in:
Travis Cross 2014-12-25 03:51:30 +00:00
parent 5ae9e6c988
commit 3c8dd3e4df
1 changed files with 17 additions and 12 deletions

29
debian/util.sh vendored
View File

@ -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 \