Package: im-config
Version: 0.22-2
Severity: normal
Tags: patch upstream

It seems that 20_ibus.rc is ultimately sourced by the user's shell. I
couldn't find what script seems to source Xsession but the behavior of:

ls /usr/lib/*/gtk-2.0/*/immodules/im-ibus.so \
/usr/lib/gtk-2.0/*/immodules/im-ibus.so 2>/dev/null || true

is to not run ls at all because the second line doesn't match any path
on my system. This is the normal behavior of zsh but dash (which /bin/sh
is linked too on my system) would output
/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-ibus.so on my
system.

The attached patch makes the sourcing work when the shell is zsh and
should work too for other shell (at least bourne shells).

Best regards.

-- System Information:
Debian Release: jessie/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'unstable'), (500, 'testing'), 
(500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.8-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages im-config depends on:
ii  dialog        1.2-20130523-1
ii  gettext-base  0.18.1.1-10
ii  zenity        3.8.0-1

Versions of packages im-config recommends:
ii  dialog      1.2-20130523-1
ii  x11-common  1:7.7+3

im-config suggests no packages.

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/share/im-config/data/20_ibus.rc (from im-config 
package)
diff -Nru im-config-0.22/debian/changelog im-config-0.22/debian/changelog
--- im-config-0.22/debian/changelog	2013-06-04 16:36:39.000000000 +0200
+++ im-config-0.22/debian/changelog	2013-06-23 15:52:21.000000000 +0200
@@ -1,3 +1,10 @@
+im-config (0.22-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix sourcing of data/20_ibus.rc in zsh shell. Closes: #713885
+
+ -- Thomas Preud'homme <robo...@debian.org>  Sun, 23 Jun 2013 15:51:15 +0200
+
 im-config (0.22-3) unstable; urgency=low
 
   * Fix typo regression in 0.22-2. Closes: #710969
diff -Nru im-config-0.22/debian/patches/fix_sourcing_ibus.rc_from_zsh.diff im-config-0.22/debian/patches/fix_sourcing_ibus.rc_from_zsh.diff
--- im-config-0.22/debian/patches/fix_sourcing_ibus.rc_from_zsh.diff	1970-01-01 01:00:00.000000000 +0100
+++ im-config-0.22/debian/patches/fix_sourcing_ibus.rc_from_zsh.diff	2013-06-23 16:06:00.000000000 +0200
@@ -0,0 +1,69 @@
+Description: Fix sourcing 20_ibus.rc from zsh
+ When a user starts an X session, 20_ibus.rc is sourced ultimately by
+ XSession script which runs with the user's shell (probably because it's
+ itself sourced instead of being executed). But when the user's shell is zsh,
+ the ls /usr/lib/*/foo/* /usr/lib/foo/* does not output anything because in zsh
+ when a wildcard does not match any path the command is not executed.
+ Therefore, the markers are not exported and (GTK|QT4)_IM_MODULE is not
+ exported which leads to dead letters not functionning because ibus is running
+ but not used.
+Author: Thomas Preud'homme <robo...@debian.org>
+Bug-Debian: http://bugs.debian.org/713885
+
+---
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/713885
+Forwarded: no
+Last-Update: 2013-06-23
+
+--- im-config-0.22.orig/data/20_ibus.rc
++++ im-config-0.22/data/20_ibus.rc
+@@ -13,8 +13,8 @@ XMODIFIERS=@im=ibus
+ GTK_IM_MODULE=xim
+ # use immodule only when available for both GTK 2.0 and 3.0
+ IM_CONFIG_MARKER2=0
+-for IM_CONFIG_MARKER in $(ls /usr/lib/*/gtk-2.0/*/immodules/im-ibus.so \
+-                        /usr/lib/gtk-2.0/*/immodules/im-ibus.so 2>/dev/null || true); do
++for IM_CONFIG_MARKER in $({ ls /usr/lib/*/gtk-2.0/*/immodules/im-ibus.so; \
++                        ls /usr/lib/gtk-2.0/*/immodules/im-ibus.so } 2>/dev/null || true); do
+     if [ -e $IM_CONFIG_MARKER ]; then
+         IM_CONFIG_MARKER2=1
+         break
+@@ -22,21 +22,22 @@ for IM_CONFIG_MARKER in $(ls /usr/lib/*/
+ done
+ 
+ IM_CONFIG_MARKER3=0
+-for IM_CONFIG_MARKER in $(ls /usr/lib/*/gtk-3.0/*/immodules/im-ibus.so \
+-                        /usr/lib/gtk-3.0/*/immodules/im-ibus.so 2>/dev/null||true); do
++for IM_CONFIG_MARKER in $({ ls /usr/lib/*/gtk-3.0/*/immodules/im-ibus.so; \
++                        ls /usr/lib/gtk-3.0/*/immodules/im-ibus.so } 2>/dev/null || true); do
+     if [ -e $IM_CONFIG_MARKER ]; then
+         IM_CONFIG_MARKER3=1
+         break
+     fi
+ done
++
+ if [ $IM_CONFIG_MARKER2 = 1 ] && [ $IM_CONFIG_MARKER3 = 1 ] ; then
+     GTK_IM_MODULE=ibus
+ fi
+ 
+ QT4_IM_MODULE=xim
+ # use immodule when available for Qt4 (Qt3 has been long dead)
+-for IM_CONFIG_MARKER in $(ls /usr/lib/*/qt4/plugins/inputmethods/libqtim-ibus.so\
+-                        /usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so 2>/dev/null||true) ; do
++for IM_CONFIG_MARKER in $({ ls /usr/lib/*/qt4/plugins/inputmethods/libqtim-ibus.so; \
++                        ls /usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so } 2>/dev/null || true) ; do
+     if [ -e $IM_CONFIG_MARKER ]; then
+         QT4_IM_MODULE=ibus
+         break
+@@ -45,8 +46,8 @@ done
+ 
+ CLUTTER_IM_MODULE=xim
+ # use immodule when available for clutter
+-for IM_CONFIG_MARKER in $(ls /usr/lib/*/clutter-imcontext/immodules/im-ibus.so \
+-                        /usr/lib/clutter-imcontext/immodules/im-ibus.so 2>/dev/null||true); do
++for IM_CONFIG_MARKER in $({ ls /usr/lib/*/clutter-imcontext/immodules/im-ibus.so; \
++                        ls /usr/lib/clutter-imcontext/immodules/im-ibus.so } 2>/dev/null || true); do
+     if [ -e $IM_CONFIG_MARKER ]; then
+         CLUTTER_IM_MODULE=ibus
+         break
diff -Nru im-config-0.22/debian/patches/series im-config-0.22/debian/patches/series
--- im-config-0.22/debian/patches/series	2013-05-29 14:37:33.000000000 +0200
+++ im-config-0.22/debian/patches/series	2013-06-23 15:53:08.000000000 +0200
@@ -1 +1,2 @@
 0001-BUG709921.patch
+fix_sourcing_ibus.rc_from_zsh.diff

Reply via email to