From cbb2852a388268a63b4855dbfa2cb577e159c1a461d228c263a95e13feb484a4 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 2 Apr 2009 16:55:24 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/x11-tools?expand=0&rev=14 --- x11-tools.changes | 6 ++++++ x11-tools.spec | 5 ++++- xim | 38 +++++++++++++++++++++----------------- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/x11-tools.changes b/x11-tools.changes index b9760bf..c0b4af3 100644 --- a/x11-tools.changes +++ b/x11-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 27 16:35:44 CET 2009 - werner@suse.de + +- Speed up adding user environment for the case of having a bash + as login shell, requested by Michael Meeks + ------------------------------------------------------------------- Fri Mar 6 20:17:41 CET 2009 - sndirsch@suse.de diff --git a/x11-tools.spec b/x11-tools.spec index 19a82a0..925b7e2 100644 --- a/x11-tools.spec +++ b/x11-tools.spec @@ -26,7 +26,7 @@ Provides: xf86tools 3ddiag Obsoletes: xf86tools 3ddiag AutoReqProv: on Version: 0.1 -Release: 169 +Release: 170 Summary: Tools for the X Window System Source2: xf86debug Source3: switch2nv @@ -86,6 +86,9 @@ install -m 755 $RPM_SOURCE_DIR/switch2nvidia $RPM_BUILD_ROOT/usr/bin /var/adm/fillup-templates/sysconfig.language-%{name} %changelog +* Fri Mar 27 2009 werner@suse.de +- Speed up adding user environment for the case of having a bash + as login shell, requested by Michael Meeks * Fri Mar 06 2009 sndirsch@suse.de - wmlist: icewm --> icewm-session (bnc #473511) * Tue Feb 24 2009 sndirsch@suse.de diff --git a/xim b/xim index e0bb241..a6f96ea 100644 --- a/xim +++ b/xim @@ -59,24 +59,30 @@ echo "/etc/X11/xim: Checking whether an input method should be started." # Get variables from the user environment which might influence the start # of an input method (see bug #235044, written by Werner Fink ): # -if shopt -q extglob ; then - extglob=1 -else - extglob=0 - shopt -s extglob -fi adduserenv () { local cur var=${1+"$@"} - - var=${var// /|} - while read cur; do - case "$cur" in - @($var)=*) - echo "/etc/X11/xim: user environment variable $cur" - eval $cur - esac - done < <(exec -l -a ${SHELL##*/} $SHELL -c printenv) + case "$SHELL" in + */sh|*/ash|*/bash|*/ksh|*/pdksh|*/zsh) + if test -s "$HOME/.profile" ; then + eval $((echo . "'$HOME/.profile'" + echo "set +u +e" + for cur in $var; do + echo echo \${$cur+"export $cur=\$$cur;"} + done) | $SHELL) + fi + ;; + */csh|*/tcsh) + if test -s "$HOME/.login" ; then + eval $((echo onintr - + echo source "'$HOME/.login'" + echo unset verbose + for cur in $var; do + echo if \( \${?$cur} \) echo export $cur=\`printenv $cur\` + done) | $SHELL) + fi + ;; + esac } # if gdm passes the language to Xsession, we should not override this @@ -90,8 +96,6 @@ else adduserenv LANG LC_CTYPE LC_ALL INPUT_METHOD fi -test $extglob -eq 0 && shopt -u extglob - # if INPUT_METHOD is already set to something non-empty here, # the user must have set it in ~/.profile or ~/.login or on the # command line before using startx. In that case, don't