Hello community,

here is the log from the commit of package ibus-pinyin for openSUSE:Factory 
checked in at 2018-11-26 10:28:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ibus-pinyin (Old)
 and      /work/SRC/openSUSE:Factory/.ibus-pinyin.new.19453 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ibus-pinyin"

Mon Nov 26 10:28:22 2018 rev:34 rq:651094 version:1.5.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/ibus-pinyin/ibus-pinyin.changes  2017-06-01 
16:34:48.165615450 +0200
+++ /work/SRC/openSUSE:Factory/.ibus-pinyin.new.19453/ibus-pinyin.changes       
2018-11-26 10:28:56.941123493 +0100
@@ -1,0 +2,7 @@
+Tue Nov 20 09:30:26 UTC 2018 - qz...@suse.com
+
+- Add ibus-pinyin-avoid-setup-crash.patch: To avoid 
+  ibus-pinyin-setup crash in the mixed env of Python2 and Python3
+  (boo#1116485).
+
+-------------------------------------------------------------------

New:
----
  ibus-pinyin-avoid-setup-crash.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ibus-pinyin.spec ++++++
--- /var/tmp/diff_new_pack.Jcfq6y/_old  2018-11-26 10:28:57.585122737 +0100
+++ /var/tmp/diff_new_pack.Jcfq6y/_new  2018-11-26 10:28:57.585122737 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ibus-pinyin
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
 Version:        1.5.0
 Release:        0
 Summary:        The PinYin engine for IBus platform
-License:        GPL-2.0+
+License:        GPL-2.0-or-later
 Group:          System/I18n/Chinese
 Provides:       locale(ibus:zh)
 Url:            http://code.google.com/p/ibus/
@@ -35,6 +35,8 @@
 Patch4:         ibus-pinyin-default-full.patch
 # PATCH-FIX-UPSTREAM ibus-pinyin-select-words-could-be-cleared.patch 
hillw...@opensuse.org boo#980890 -- The selected words could be cleared while 
use ibus-pinyin in Firefox.
 Patch5:         ibus-pinyin-fix-select-words-could-be-cleared.patch
+# PATCH-FIX-OPENSUSE ibus-pinyin-avoid-setup-crash.patch qz...@suse.com 
boo#1116485 -- To avoid ibus-pinyin-setup crash in the mixed env of Python2 and 
Python3.
+Patch6:         ibus-pinyin-avoid-setup-crash.patch
 %if 0%{?suse_version} > 1325
 BuildRequires:  libboost_headers-devel
 %else
@@ -71,9 +73,12 @@
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 %build
-%configure --disable-static --libexecdir=%{_prefix}/%{_lib}/ibus
+%configure --disable-static \
+           --libexecdir=%{_prefix}/%{_lib}/ibus \
+           --with-python=python3
 
 # make -C po update-gmo
 make %{?_smp_mflags}
@@ -88,7 +93,8 @@
 
 %files -f %{name}.lang
 %defattr(-,root,root,-)
-%doc AUTHORS COPYING README
+%doc AUTHORS README
+%license COPYING
 %{_datadir}/ibus-pinyin
 %{_datadir}/applications/ibus-*.desktop
 %dir %{_datadir}/ibus

++++++ ibus-pinyin-avoid-setup-crash.patch ++++++
diff -Nura ibus-pinyin-1.5.0/configure ibus-pinyin-1.5.0_new/configure
--- ibus-pinyin-1.5.0/configure 2012-12-18 05:16:36.000000000 +0800
+++ ibus-pinyin-1.5.0_new/configure     2018-11-20 20:17:35.542730466 +0800
@@ -836,6 +836,7 @@
 with_gnu_ld
 with_sysroot
 enable_libtool_lock
+with_python
 enable_boost
 with_boost
 enable_lua_extension
@@ -1512,6 +1513,7 @@
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-sysroot=DIR Search for dependent libraries within DIR
                         (or the compiler's sysroot if not specified).
+  --with-python=PATH      Select python2 or python3
   --with-boost=DIR        prefix of Boost 1.39 [guess]
 
 Some influential environment variables:
@@ -17550,6 +17552,14 @@
 
 
 
+# Define python version
+
+# Check whether --with-python was given.
+if test "${with_python+set}" = set; then :
+  withval=$with_python; PYTHON=$with_python
+fi
+
+
 # check python
 
 
@@ -17578,7 +17588,9 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  as_fn_error $? "too old" "$LINENO" 5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                               as_fn_error $? "Python interpreter is too old" 
"$LINENO" 5
 fi
       am_display_PYTHON=$PYTHON
     else
@@ -17590,7 +17602,7 @@
   $as_echo_n "(cached) " >&6
 else
 
-       for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 
python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 
python2.1 python2.0 none; do
+       for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 
python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 
python2.2 python2.1 python2.0 none; do
          test "$am_cv_pathless_PYTHON" = none && break
          prog="import sys
 # split strings by '.' and convert to numeric.  Append some zeros
@@ -17697,6 +17709,25 @@
   PYTHON_PLATFORM=$am_cv_python_platform
 
 
+  # Just factor out some code duplication.
+  am_python_setup_sysconfig="\
+import sys
+# Prefer sysconfig over distutils.sysconfig, for better compatibility
+# with python 3.x.  See automake bug#10227.
+try:
+    import sysconfig
+except ImportError:
+    can_use_sysconfig = 0
+else:
+    can_use_sysconfig = 1
+# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
+# <https://github.com/pypa/virtualenv/issues/118>
+try:
+    from platform import python_implementation
+    if python_implementation() == 'CPython' and sys.version[:3] == '2.7':
+        can_use_sysconfig = 0
+except ImportError:
+    pass"
 
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 
$am_display_PYTHON script directory" >&5
@@ -17710,7 +17741,14 @@
      else
        am_py_prefix=$prefix
      fi
-     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import 
sysconfig; 
sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 
2>/dev/null`
+     am_cv_python_pythondir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+    sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+else:
+    from distutils import sysconfig
+    sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
      case $am_cv_python_pythondir in
      $am_py_prefix*)
        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -17747,7 +17785,14 @@
      else
        am_py_exec_prefix=$exec_prefix
      fi
-     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import 
sysconfig; 
sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 
2>/dev/null`
+     am_cv_python_pyexecdir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+    sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
+else:
+    from distutils import sysconfig
+    sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
      case $am_cv_python_pyexecdir in
      $am_py_exec_prefix*)
        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -21674,6 +21719,7 @@
     Version                     $VERSION
     Install prefix              $prefix
     Use boost                   $enable_boost
+    python                      $PYTHON
     Build lua extension         $enable_lua_extension
     Build english input mode    $enable_english_input_mode
 " >&5
@@ -21682,6 +21728,7 @@
     Version                     $VERSION
     Install prefix              $prefix
     Use boost                   $enable_boost
+    python                      $PYTHON
     Build lua extension         $enable_lua_extension
     Build english input mode    $enable_english_input_mode
 " >&6; }
diff -Nura ibus-pinyin-1.5.0/configure.ac ibus-pinyin-1.5.0_new/configure.ac
--- ibus-pinyin-1.5.0/configure.ac      2012-12-18 05:16:30.000000000 +0800
+++ ibus-pinyin-1.5.0_new/configure.ac  2018-11-20 20:19:05.450483852 +0800
@@ -81,6 +81,13 @@
 AC_PATH_PROG(ENV, env)
 AC_SUBST(ENV)
 
+# Define python version
+AC_ARG_WITH(python,
+    AS_HELP_STRING([--with-python[=PATH]],
+        [Select python2 or python3]),
+    [PYTHON=$with_python], []
+)
+
 # check python
 AM_PATH_PYTHON([2.5])
 
@@ -166,6 +173,7 @@
     Version                     $VERSION
     Install prefix              $prefix
     Use boost                   $enable_boost
+    python                      $PYTHON
     Build lua extension         $enable_lua_extension
     Build english input mode    $enable_english_input_mode
 ])
diff -Nura ibus-pinyin-1.5.0/setup/ibus-setup-pinyin.in 
ibus-pinyin-1.5.0_new/setup/ibus-setup-pinyin.in
--- ibus-pinyin-1.5.0/setup/ibus-setup-pinyin.in        2012-07-09 
22:32:10.000000000 +0800
+++ ibus-pinyin-1.5.0_new/setup/ibus-setup-pinyin.in    2018-11-20 
20:19:05.450483852 +0800
@@ -26,5 +26,4 @@
 export IBUS_DATAROOTDIR=@datarootdir@
 export IBUS_LOCALEDIR=@localedir@
 cd @prefix@/share/ibus-pinyin/setup/
-exec python main.py $@
-
+exec @PYTHON@ main.py $@
diff -Nura ibus-pinyin-1.5.0/setup/main.py ibus-pinyin-1.5.0_new/setup/main.py
--- ibus-pinyin-1.5.0/setup/main.py     2012-07-09 22:32:10.000000000 +0800
+++ ibus-pinyin-1.5.0_new/setup/main.py 2018-11-20 20:19:05.450483852 +0800
@@ -20,15 +20,21 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
+from __future__ import print_function
+
 import gettext
 import locale
 import os
 import sys
 
+from gi import require_version as gi_require_version
+gi_require_version('GLib', '2.0')
+gi_require_version('Gtk', '3.0')
+gi_require_version('IBus', '1.0')
+
 from gi.repository import GLib
 from gi.repository import Gtk
 from gi.repository import IBus
-from xdg import BaseDirectory
 
 import version
 
@@ -250,6 +256,8 @@
 
         def __correct_pinyin_toggled_cb(widget):
             val = widget.get_active()
+            for w in self.__correct_pinyin_widgets:
+                self.__builder.get_object(w[0]).set_sensitive(val)
             map(lambda w: self.__builder.get_object(w[0]).set_sensitive(val),
                 self.__correct_pinyin_widgets)
         self.__correct_pinyin.connect("toggled", __correct_pinyin_toggled_cb)
@@ -300,8 +308,8 @@
 
         def __fuzzy_pinyin_toggled_cb(widget):
             val = widget.get_active()
-            map(lambda w: self.__builder.get_object(w[0]).set_sensitive(val),
-                self.__fuzzy_pinyin_widgets)
+            for w in self.__fuzzy_pinyin_widgets:
+                self.__builder.get_object(w[0]).set_sensitive(val)
         self.__fuzzy_pinyin.connect("toggled", __fuzzy_pinyin_toggled_cb)
 
         # init value
@@ -404,7 +412,7 @@
         elif isinstance(val, str):
             var = GLib.Variant.new_string(val)
         else:
-            print >> sys.stderr, "val(%s) is not in support type." % repr(val)
+            print("val(%s) is not in support type." % repr(val), 
file=sys.stderr)
             return
 
         self.__values[name] = val

Reply via email to