From: Travis Cross Date: Thu, 25 Dec 2014 03:58:49 +0000 (+0000) Subject: Refactor distro detection and handling X-Git-Tag: v1.4.15^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=505cd2947aa2ea553b6a9a1e19d8b4ee18bd8523;p=thirdparty%2Ffreeswitch.git Refactor distro detection and handling --- diff --git a/debian/util.sh b/debian/util.sh index 052762b91c..4a5214a9bb 100755 --- a/debian/util.sh +++ b/debian/util.sh @@ -357,6 +357,16 @@ build_debs () { echo ${dsc%.dsc}_${arch}.changes } +default_distros () { + local host_distro="Debian" + test -z "$(which lsb_release)" || host_distro="$(lsb_release -is)" + case "$host_distro" in + Debian) echo "sid jessie wheezy" ;; + Ubuntu) echo "utopic trusty" ;; + *) err "Unknown distribution" ;; + esac +} + build_all () { local OPTIND OPTARG local orig_opts="" dsc_opts="" deb_opts="" modlist="" @@ -385,25 +395,7 @@ build_all () { done shift $(($OPTIND-1)) [ -n "$archs" ] || archs="amd64 i386" - if [ -z "$distros" ]; then - 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 + [ -n "$distros" ] || distros="$(default_distros)" ! $depinst || aptitude install -y \ rsync git less cowbuilder ccache \ devscripts equivs build-essential