Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 412003
Collapse All | Expand All

(-)a/usr/portage/x11-apps/xinit/files/chooser.sh (-3 / +32 lines)
Lines 13-23 Link Here
13
	fi
13
	fi
14
done
14
done
15
15
16
# Find a match for $XSESSION in /usr/share/xsessions
17
DESKTOP_XSESSION=""
18
for y in /usr/share/xsessions/*.desktop ; do
19
	if [ "`echo ${y##*/} | awk '{ print toupper($1) }'`" \
20
		= "`echo ${XSESSION}.desktop | awk '{ print toupper($1) }'`" ]; then
21
		DESKTOP_XSESSION=${y}
22
		break
23
	fi
24
done
25
16
GENTOO_EXEC=""
26
GENTOO_EXEC=""
17
27
18
if [ -n "${XSESSION}" ]; then
28
if [ -n "${XSESSION}" ]; then
19
	if [ -f /etc/X11/Sessions/${XSESSION} ]; then
29
	if [ -f "/etc/X11/Sessions/${XSESSION}" ]; then
20
		if [ -x /etc/X11/Sessions/${XSESSION} ]; then
30
		if [ -x "/etc/X11/Sessions/${XSESSION}" ]; then
21
			GENTOO_EXEC="/etc/X11/Sessions/${XSESSION}"
31
			GENTOO_EXEC="/etc/X11/Sessions/${XSESSION}"
22
		else
32
		else
23
			GENTOO_EXEC="/bin/sh /etc/X11/Sessions/${XSESSION}"
33
			GENTOO_EXEC="/bin/sh /etc/X11/Sessions/${XSESSION}"
Lines 28-34 Link Here
28
		else
38
		else
29
			GENTOO_EXEC="/bin/sh ${GENTOO_SESSION}"
39
			GENTOO_EXEC="/bin/sh ${GENTOO_SESSION}"
30
		fi
40
		fi
31
	else
41
	elif [ -n "${DESKTOP_XSESSION}" ]; then
42
		EXEC="`sed -n -e 's/^Exec=//p' <${DESKTOP_XSESSION}`"
43
	elif [ "${XSESSION}" = "`echo ${XSESSION} | tr -d ' '`" ]; then 
32
		x=""
44
		x=""
33
		y=""
45
		y=""
34
		
46
		
Lines 42-47 Link Here
42
				break
54
				break
43
			fi
55
			fi
44
		done
56
		done
57
	else # XSESSION contains spaces
58
		EXEC="${XSESSION}"
59
	fi
60
	if [ -n "${EXEC}" ]; then
61
		x="${EXEC%% *}"
62
		if [ "${x}" = "${EXEC}" ]; then
63
			y=""
64
		else
65
			y="${EXEC#* }"
66
		fi
67
68
		if [ -x "`which ${x} 2>/dev/null`" ]; then
69
			GENTOO_EXEC="`which ${x} 2>/dev/null`"
70
			if [ -n "${y}" ]; then
71
				GENTOO_EXEC="${GENTOO_EXEC} ${y}"
72
			fi
73
		fi
45
	fi
74
	fi
46
fi
75
fi
47
76

Return to bug 412003