Hello community, here is the log from the commit of package pyzy for openSUSE:Factory checked in at 2015-02-27 10:59:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pyzy (Old) and /work/SRC/openSUSE:Factory/.pyzy.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "pyzy" Changes: -------- --- /work/SRC/openSUSE:Factory/pyzy/pyzy.changes 2013-11-24 13:23:38.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.pyzy.new/pyzy.changes 2015-02-27 11:00:34.000000000 +0100 @@ -1,0 +2,11 @@ +Thu Feb 26 03:27:50 UTC 2015 - hillwood@linuxfans.org + +- Add patch: pyzy-opencc-1_0_2-build.patch + * Use opencc 1.0.2 + +------------------------------------------------------------------- +Wed Feb 25 06:45:17 UTC 2015 - hillwood@linuxfans.org + +- Disable opencc build. + +------------------------------------------------------------------- New: ---- pyzy-opencc-1_0_2-build.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pyzy.spec ++++++ --- /var/tmp/diff_new_pack.fAaVoL/_old 2015-02-27 11:00:36.000000000 +0100 +++ /var/tmp/diff_new_pack.fAaVoL/_new 2015-02-27 11:00:36.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package pyzy # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 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 @@ -23,11 +23,13 @@ License: LGPL-2.1 Group: System/I18n/Chinese Url: http://code.google.com/p/pyzy - Source0: %{name}-%{version}.tar.gz Source1: pyzy-database-1.0.0.tar.bz2 Source2: pinyin-database-1.2.99.tar.bz2 +# PATCH-FIX-UPSTREAM autofix.diff jengelh@inai.de -- resolve build errors with old automake Patch1: autofix.diff +# PATCH-FIX-UPSTREAM pyzy-opencc-1_0_2-build.patch hillwood@opensuse.org -- Use opencc 1.0.2 +Patch2: pyzy-opencc-1_0_2-build.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: gcc-c++ BuildRequires: glib2-devel >= 2.24.0 @@ -88,6 +90,7 @@ %prep %setup -q %patch -P 1 -p1 +%patch2 -p1 cp %{SOURCE1} data/db/open-phrase cp %{SOURCE2} data/db/open-phrase ++++++ pyzy-opencc-1_0_2-build.patch ++++++ diff -Nur pyzy-1.0git20120805/src/SimpTradConverter.cc pyzy-1.0git20120805-new/src/SimpTradConverter.cc --- pyzy-1.0git20120805/src/SimpTradConverter.cc 2012-08-03 10:36:31.000000000 +0800 +++ pyzy-1.0git20120805-new/src/SimpTradConverter.cc 2015-02-26 09:40:41.243684651 +0800 @@ -40,7 +40,6 @@ #ifdef HAVE_OPENCC class opencc { - static const int BUFFER_SIZE = 64; public: opencc (void) { @@ -55,29 +54,13 @@ void convert (const char *in, String &out) { - long n_char; - unichar *in_ucs4 = g_utf8_to_ucs4_fast (in, -1, &n_char); - - ucs4_t *pinbuf = (ucs4_t *)in_ucs4; - size_t inbuf_left = n_char; - while (inbuf_left != 0) { - ucs4_t *poutbuf = (ucs4_t *)m_buffer; - size_t outbuf_left = BUFFER_SIZE; - size_t retval = opencc_convert(m_od, &pinbuf, &inbuf_left, &poutbuf, &outbuf_left); - if (retval == (size_t) -1) { - /* append left chars in pinbuf */ - g_warning ("opencc_convert return failed"); - out << (unichar *) pinbuf; - break; - } - *poutbuf = L'\0'; - out << m_buffer; - } - g_free (in_ucs4); + char * converted = opencc_convert_utf8 (m_od, in, -1); + g_assert (converted != NULL); + out = converted; + opencc_convert_utf8_free (converted); } private: opencc_t m_od; - unichar m_buffer[BUFFER_SIZE + 1]; }; void -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org