Autodetecting mode depending on which distribution we're building.

This commit is contained in:
Daniel Baumann 2012-01-23 13:42:47 +01:00
parent 98932c4edf
commit 43105e7a2d
1 changed files with 22 additions and 1 deletions

View File

@ -26,7 +26,28 @@ Set_defaults ()
LB_SYSTEM="${LB_SYSTEM:-live}"
# Setting mode (currently: debian, emdebian, progress, ubuntu and kubuntu)
LB_MODE="${LB_MODE:-debian}"
if [ -x /usr/bin/lsb_release ]
then
_DISTRIBUTOR="$(lsb_release -is | tr [A-Z] [a-z])"
case "${_DISTRIBUTOR}" in
debian|progress|ubuntu)
LB_MODE="${LB_MODE:-${_DISTRIBUTOR}}"
;;
*)
LB_MODE="${LB_MODE:-debian}"
;;
esac
else
if [ -e /etc/progress_version ]
then
LB_MODE="${LB_MODE:-progress}"
elif [ -e /etc/ubuntu_version ]
then
LB_MODE="${LB_MODE:-ubuntu}"
fi
fi
# Setting distribution name
case "${LB_MODE}" in