Improvements to provided scripts (Resolves #549551)

This commit is contained in:
Matej Cepl 2010-01-29 09:33:32 +00:00
parent 1d9d1cc2ac
commit ae42efc48b
4 changed files with 14 additions and 11 deletions

View File

@ -8,8 +8,8 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
GSESSION="$(which gnome-session 2>/dev/null)" GSESSION="$(type -p gnome-session)"
STARTKDE="$(which startkde 2>/dev/null)" STARTKDE="$(type -p startkde)"
# check to see if the user has a preferred desktop # check to see if the user has a preferred desktop
PREFERRED= PREFERRED=
@ -39,7 +39,7 @@ fi
# We should also support /etc/X11/xinit/Xclients.d scripts # We should also support /etc/X11/xinit/Xclients.d scripts
XCLIENTS_D=/etc/X11/xinit/Xclients.d XCLIENTS_D=/etc/X11/xinit/Xclients.d
if [ -d "$XCLIENTS_D" -a "$#" -eq 1 -a -x "$XCLIENTS_D/Xclients.$1.sh" ]; then if [ "$#" -eq 1 ] && [ -x "$XCLIENTS_D/Xclients.$1.sh" ]; then
exec -l $SHELL -c "$SSH_AGENT $XCLIENTS_D/Xclients.$1.sh" exec -l $SHELL -c "$SSH_AGENT $XCLIENTS_D/Xclients.$1.sh"
fi fi
@ -56,8 +56,6 @@ rm -f $HOME/Xrootenv.0
if [ -x /usr/bin/xclock ] ; then if [ -x /usr/bin/xclock ] ; then
/usr/bin/xclock -geometry 100x100-5+5 & /usr/bin/xclock -geometry 100x100-5+5 &
elif [ -x /usr/bin/xclock ] ; then
/usr/bin/xclock -geometry 100x100-5+5 &
fi fi
if [ -x /usr/bin/xterm ] ; then if [ -x /usr/bin/xterm ] ; then
/usr/bin/xterm -geometry 80x50-50+150 & /usr/bin/xterm -geometry 80x50-50+150 &

View File

@ -40,7 +40,7 @@ SWITCHDESKPATH=/usr/share/switchdesk
# and hard coded window managers and desktop environments will be removed from # and hard coded window managers and desktop environments will be removed from
# this script. # this script.
XCLIENTS_D=/etc/X11/xinit/Xclients.d XCLIENTS_D=/etc/X11/xinit/Xclients.d
if [ -d "$XCLIENTS_D" -a "$#" -eq 1 -a -x "$XCLIENTS_D/Xclients.$1.sh" ]; then if [ "$#" -eq 1 ] && [ -x "$XCLIENTS_D/Xclients.$1.sh" ]; then
exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $XCLIENTS_D/Xclients.$1.sh" exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $XCLIENTS_D/Xclients.$1.sh"
else else
# now, we see if xdm/gdm/kdm has asked for a specific environment # now, we see if xdm/gdm/kdm has asked for a specific environment

View File

@ -1,4 +1,3 @@
#!/bin/bash
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This # Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify, # copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the # copy, or redistribute it subject to the terms and conditions of the
@ -56,7 +55,7 @@ done
# Prefix launch of session with ssh-agent if available and not already running. # Prefix launch of session with ssh-agent if available and not already running.
SSH_AGENT= SSH_AGENT=
if [ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ]; then if [ -z "$SSH_AGENT_PID" ] && [ -x /usr/bin/ssh-agent ]; then
if [ "x$TMPDIR" != "x" ]; then if [ "x$TMPDIR" != "x" ]; then
SSH_AGENT="/usr/bin/ssh-agent /bin/env TMPDIR=$TMPDIR" SSH_AGENT="/usr/bin/ssh-agent /bin/env TMPDIR=$TMPDIR"
else else
@ -65,6 +64,6 @@ if [ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ]; then
fi fi
CK_XINIT_SESSION= CK_XINIT_SESSION=
if [ -x /usr/bin/ck-xinit-session -a -z "$XDG_SESSION_COOKIE" ]; then if [ -z "$XDG_SESSION_COOKIE" ] && [ -x /usr/bin/ck-xinit-session ]; then
CK_XINIT_SESSION="/usr/bin/ck-xinit-session" CK_XINIT_SESSION="/usr/bin/ck-xinit-session"
fi fi

View File

@ -41,7 +41,6 @@ Requires: xauth
Requires: coreutils Requires: coreutils
Requires: xorg-x11-server-utils Requires: xorg-x11-server-utils
Requires: ConsoleKit-x11 Requires: ConsoleKit-x11
Requires: which
# NOTE: Most of the xinitrc scripts/config files are now in xorg-x11-xinit, # NOTE: Most of the xinitrc scripts/config files are now in xorg-x11-xinit,
# so the xinitrc package became unnecessary. The xdm configs/scripts move # so the xinitrc package became unnecessary. The xdm configs/scripts move
@ -90,7 +89,9 @@ install -m644 -D $RPM_SOURCE_DIR/xinit-compat.desktop $RPM_BUILD_ROOT%{_datadir}
# Install Red Hat custom xinitrc, etc. # Install Red Hat custom xinitrc, etc.
{ {
for script in %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE16} ; do install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/xinitrc-common
for script in %{SOURCE11} %{SOURCE12} %{SOURCE16} ; do
install -m 755 $script $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/${script##*/} install -m 755 $script $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/${script##*/}
done done
@ -131,6 +132,11 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/xsessions/xinit-compat.desktop %{_datadir}/xsessions/xinit-compat.desktop
%changelog %changelog
* Tue Dec 22 2009 Ville Skyttä <ville.skytta@iki.fi>
- Eliminate dependency on which.
- Change Xclients, Xsession and xinitrc-common to make fewer stat calls.
- Install xinitrc-common non-executable.
* Tue Nov 10 2009 Matěj Cepl <mcepl@redhat.com> - 1.0.9-13 * Tue Nov 10 2009 Matěj Cepl <mcepl@redhat.com> - 1.0.9-13
- Fix SELinux labels on $errfile (fixes bug# 530419) - Fix SELinux labels on $errfile (fixes bug# 530419)