Simplify chroot detection code

This commit is contained in:
Panayiotis Kkolos 2014-03-09 06:40:23 +02:00 committed by Olivier Mengué
parent 82425e51b0
commit cbba559340

View File

@ -489,19 +489,10 @@ _lp_connection()
# The connection is not expected to change from inside the shell, so we # The connection is not expected to change from inside the shell, so we
# build this just once # build this just once
LP_HOST="" LP_HOST=""
_chroot() [[ -r /etc/debian_chroot ]] && LP_HOST="($(< /etc/debian_chroot))"
{
if [[ -r /etc/debian_chroot ]] ; then
local debchroot
debchroot="$(< /etc/debian_chroot)"
echo "(${debchroot})"
fi
}
LP_HOST="$(_chroot)"
unset _chroot
# If we are connected with a X11 support # If we are connected with a X11 support
if [[ -n "$DISPLAY" ]] ; then if [[ -n "$DISPLAY" ]]; then
LP_HOST="${LP_COLOR_X11_ON}${LP_HOST}@${NO_COL}" LP_HOST="${LP_COLOR_X11_ON}${LP_HOST}@${NO_COL}"
else else
LP_HOST="${LP_COLOR_X11_OFF}${LP_HOST}@${NO_COL}" LP_HOST="${LP_COLOR_X11_OFF}${LP_HOST}@${NO_COL}"