Hello community, here is the log from the commit of package libdatrie for openSUSE:Factory checked in at 2018-02-21 14:07:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libdatrie (Old) and /work/SRC/openSUSE:Factory/.libdatrie.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libdatrie" Wed Feb 21 14:07:53 2018 rev:20 rq:578035 version:0.2.10 Changes: -------- --- /work/SRC/openSUSE:Factory/libdatrie/libdatrie.changes 2015-09-09 20:19:59.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libdatrie.new/libdatrie.changes 2018-02-21 14:07:57.505779969 +0100 @@ -1,0 +2,15 @@ +Mon Feb 19 11:29:35 UTC 2018 - [email protected] + +- Fix RPM groups. Remove ineffective --with-pic. + +------------------------------------------------------------------- +Sun Feb 18 09:31:26 UTC 2018 - [email protected] + +- update to version 0.2.10 + * Correctly check doxygen version on configure + * Optimization on AlphaMap mapping +- remove libdatrie-doxygen-version-check.patch + * upstreamed in 7db54c662357dba5f109eaf1b24490f46ca23d44 +- use https urls + +------------------------------------------------------------------- Old: ---- libdatrie-0.2.9.tar.xz libdatrie-doxygen-version-check.patch New: ---- libdatrie-0.2.10.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libdatrie.spec ++++++ --- /var/tmp/diff_new_pack.719Akb/_old 2018-02-21 14:07:58.973727108 +0100 +++ /var/tmp/diff_new_pack.719Akb/_new 2018-02-21 14:07:58.973727108 +0100 @@ -1,7 +1,7 @@ # # spec file for package libdatrie # -# Copyright (c) 2015 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 @@ -17,22 +17,19 @@ Name: libdatrie -Version: 0.2.9 +Version: 0.2.10 Release: 0 Summary: Double-Array Trie Library License: LGPL-2.1 -Group: System/Libraries -Url: http://linux.thai.net/~thep/datrie/datrie.html -Source: http://linux.thai.net/pub/thailinux/software/libthai/%{name}-%{version}.tar.xz +Group: Development/Libraries/C and C++ +Url: https://linux.thai.net/~thep/datrie/datrie.html +Source: https://linux.thai.net/pub/thailinux/software/libthai/%{name}-%{version}.tar.xz Source99: baselibs.conf -# sent upstream ([email protected]) -Patch0: libdatrie-doxygen-version-check.patch BuildRequires: autoconf-archive BuildRequires: doxygen BuildRequires: libtool -BuildRequires: pkg-config +BuildRequires: pkgconfig BuildRequires: xz -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description This is an implementation of double-array structure for representing @@ -40,14 +37,14 @@ %package -n libdatrie1 Summary: Double-Array Trie Library -Group: Development/Libraries/C and C++ +Group: System/Libraries %description -n libdatrie1 This is an implementation of double-array structure for representing trie, as proposed by Junichi Aoe. %package devel -Summary: Double-Array Trie Library (development) +Summary: Development files for the Double-Array Trie library Group: Development/Libraries/C and C++ Requires: libdatrie1 = %{version} @@ -59,34 +56,30 @@ %prep %setup -q -%patch0 -p1 %build autoreconf -fiv %configure \ - --disable-static --with-pic \ + --disable-static \ --with-html-docdir=%{_docdir}/libdatrie/html make %{?_smp_mflags} %install -%makeinstall +%make_install rm -f %{buildroot}%{_libdir}/libdatrie.la # This is not installed where it should mv %{buildroot}%{_datadir}/doc/libdatrie/README.migration %{buildroot}%{_docdir}/libdatrie/ %post -n libdatrie1 -p /sbin/ldconfig - %postun -n libdatrie1 -p /sbin/ldconfig %files -n libdatrie1 -%defattr(-,root,root) %doc AUTHORS ChangeLog COPYING README %{_libdir}/libdatrie.so.1* %files devel -%defattr(-,root,root) %{_bindir}/trietool* -%doc %{_mandir}/man*/trietool*.1.gz +%{_mandir}/man*/trietool*.1%{ext_man} %{_includedir}/datrie/ %{_libdir}/libdatrie.so %{_libdir}/pkgconfig/datrie-0.2.pc ++++++ libdatrie-0.2.9.tar.xz -> libdatrie-0.2.10.tar.xz ++++++ ++++ 2458 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdatrie-0.2.9/ChangeLog new/libdatrie-0.2.10/ChangeLog --- old/libdatrie-0.2.9/ChangeLog 2015-05-03 16:22:10.000000000 +0200 +++ new/libdatrie-0.2.10/ChangeLog 2015-10-20 05:35:00.000000000 +0200 @@ -1,3 +1,62 @@ +2015-10-20 Theppitak Karoonboonyanan <[email protected]> + + * configure.ac: + - Bump library revision to reflect code changes. + + * NEWS, configure.ac: + === Version 0.2.10 === + +2015-10-13 Theppitak Karoonboonyanan <[email protected]> + + Optimize AlphaMap mapping. + + alpha_map_char_to_trie() is called everywhere before trie state + transition. It's an important bottleneck. + + We won't change the persistent AlphaMap structure, but will add + pre-calculated lookup tables for use at run-time. + + * datrie/alpha-map.c (struct _AlphaMap): + - Add members for alpha-to-trie and trie-to-alpha lookup tables. + * datrie/alpha-map.c (alpha_map_new, alpha_map_free): + - Initialize & free the tables properly. + * datrie/alpha-map.c (alpha_map_add_range -> alpha_map_add_range_only + + alpha_map_recalc_work_area): + - Split alpha_map_add_range() API into two parts: adding the range + as usual and recalculate the lookup tables. + * datrie/alpha-map.c (alpha_map_clone, alpha_map_fread_bin): + - Call alpha_map_add_range_only() repeatedly before calling + alpha_map_recalc_work_area() once. + * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char): + - Look up the pre-calculated tables instead of calculating on + every call. + + This appears to save time by 14.6% for total alpha_char_to_trie() + calls and even lower its bottleneck rank by 1 rank on a libthai + test case. It reduces 0.2% run time of the total libthai test case. + + Note that the time saved would be even more in case of multiple + uncontinuous alphabet ranges, at the expense of more memory used. + +2015-08-18 Theppitak Karoonboonyanan <[email protected]> + + Fix doxygen version checking. + + * configure.ac: + - Correctly compare doxygen versions. Simple expr comparison + didn't work with version 1.8.10. + + Thanks Petr Gajdos <[email protected]> for the patch. + +2015-06-24 Theppitak Karoonboonyanan <[email protected]> + + * datrie/tail.c (tail_set_suffix): + - Catch strdup() failure. + +2015-06-24 Theppitak Karoonboonyanan <[email protected]> + + * configure.ac: Post-release version suffix added. + 2015-05-03 Theppitak Karoonboonyanan <[email protected]> * NEWS, configure.ac: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdatrie-0.2.9/NEWS new/libdatrie-0.2.10/NEWS --- old/libdatrie-0.2.9/NEWS 2015-05-03 16:14:46.000000000 +0200 +++ new/libdatrie-0.2.10/NEWS 2015-10-20 05:33:22.000000000 +0200 @@ -1,5 +1,12 @@ libdatrie +0.2.10 (2015-10-20) +====== +- Correctly check doxygen version on configure. + (Thanks Petr Gajdos for the patch.) +- Optimization on AlphaMap mapping. + (contributing to 0.2% less run time for LibThai word breaking) + 0.2.9 (2015-05-03) ===== - Fix binary file opening on Windows diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdatrie-0.2.9/compile new/libdatrie-0.2.10/compile --- old/libdatrie-0.2.9/compile 2014-10-27 05:45:43.000000000 +0100 +++ new/libdatrie-0.2.10/compile 2015-08-15 12:37:35.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdatrie-0.2.9/configure.ac new/libdatrie-0.2.10/configure.ac --- old/libdatrie-0.2.9/configure.ac 2015-05-03 16:22:45.000000000 +0200 +++ new/libdatrie-0.2.10/configure.ac 2015-10-20 08:42:35.000000000 +0200 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(libdatrie, 0.2.9, [email protected]) +AC_INIT(libdatrie, 0.2.10, [email protected]) AC_CONFIG_SRCDIR([datrie/trie.h]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR([m4]) @@ -14,7 +14,7 @@ # Interfaces added: CURRENT++ REVISION=0 AGE++ # Interfaces changed/removed: CURRENT++ REVISION=0 AGE=0 LT_CURRENT=4 -LT_REVISION=2 +LT_REVISION=3 LT_AGE=3 AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) @@ -113,12 +113,9 @@ else AC_MSG_CHECKING([doxygen >= $DOXYGEN_REQ_VER]) DOXYGEN_VER=$($DOXYGEN --version) - if expr $DOXYGEN_VER \< $DOXYGEN_REQ_VER > /dev/null; then - AC_MSG_RESULT([$DOXYGEN_VER, no, documentation disabled]) - enable_doxygen_doc="no" - else - AC_MSG_RESULT([$DOXYGEN_VER, yes]) - fi + AX_COMPARE_VERSION([$DOXYGEN_VER],[ge],[DOXYGEN_REQ_VER], + [AC_MSG_RESULT([$DOXYGEN_VER, yes])], + [AC_MSG_RESULT([$DOXYGEN_VER, no, documentation disabled]); enable_doxygen_doc="no"]) fi fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdatrie-0.2.9/datrie/alpha-map.c new/libdatrie-0.2.10/datrie/alpha-map.c --- old/libdatrie-0.2.9/datrie/alpha-map.c 2015-02-26 10:43:21.000000000 +0100 +++ new/libdatrie-0.2.10/datrie/alpha-map.c 2015-10-13 07:13:43.000000000 +0200 @@ -90,12 +90,26 @@ struct _AlphaMap { AlphaRange *first_range; + + /* work area */ + /* alpha-to-trie map */ + AlphaChar alpha_begin; + AlphaChar alpha_end; + int alpha_map_sz; + TrieIndex *alpha_to_trie_map; + + /* trie-to-alpha map */ + int trie_map_sz; + AlphaChar *trie_to_alpha_map; }; /*-----------------------------------* * PRIVATE METHODS DECLARATIONS * *-----------------------------------*/ static int alpha_map_get_total_ranges (const AlphaMap *alpha_map); +static int alpha_map_add_range_only (AlphaMap *alpha_map, + AlphaChar begin, AlphaChar end); +static int alpha_map_recalc_work_area (AlphaMap *alpha_map); /*-----------------------------* * METHODS IMPLEMENTAIONS * @@ -133,6 +147,15 @@ alpha_map->first_range = NULL; + /* work area */ + alpha_map->alpha_begin = 0; + alpha_map->alpha_end = 0; + alpha_map->alpha_map_sz = 0; + alpha_map->alpha_to_trie_map = NULL; + + alpha_map->trie_map_sz = 0; + alpha_map->trie_to_alpha_map = NULL; + return alpha_map; } @@ -156,13 +179,18 @@ return NULL; for (range = a_map->first_range; range; range = range->next) { - if (alpha_map_add_range (alpha_map, range->begin, range->end) != 0) { - alpha_map_free (alpha_map); - return NULL; - } + if (alpha_map_add_range_only (alpha_map, range->begin, range->end) != 0) + goto exit_map_created; } + if (alpha_map_recalc_work_area (alpha_map) != 0) + goto exit_map_created; + return alpha_map; + +exit_map_created: + alpha_map_free (alpha_map); + return NULL; } /** @@ -184,6 +212,12 @@ p = q; } + /* work area */ + if (alpha_map->alpha_to_trie_map) + free (alpha_map->alpha_to_trie_map); + if (alpha_map->trie_to_alpha_map) + free (alpha_map->trie_to_alpha_map); + free (alpha_map); } @@ -214,9 +248,13 @@ if (!file_read_int32 (file, &b) || !file_read_int32 (file, &e)) goto exit_map_created; - alpha_map_add_range (alpha_map, b, e); + alpha_map_add_range_only (alpha_map, b, e); } + /* work area */ + if (UNLIKELY (alpha_map_recalc_work_area (alpha_map) != 0)) + goto exit_map_created; + return alpha_map; exit_map_created: @@ -261,20 +299,8 @@ return 0; } -/** - * @brief Add a range to alphabet map - * - * @param alpha_map : the alphabet map object - * @param begin : the first character of the range - * @param end : the last character of the range - * - * @return 0 on success, non-zero on failure - * - * Add a range of character codes from @a begin to @a end to the - * alphabet set. - */ -int -alpha_map_add_range (AlphaMap *alpha_map, AlphaChar begin, AlphaChar end) +static int +alpha_map_add_range_only (AlphaMap *alpha_map, AlphaChar begin, AlphaChar end) { AlphaRange *q, *r, *begin_node, *end_node; @@ -371,21 +397,109 @@ return 0; } +static int +alpha_map_recalc_work_area (AlphaMap *alpha_map) +{ + AlphaRange *range; + + /* free old existing map */ + if (alpha_map->alpha_to_trie_map) { + free (alpha_map->alpha_to_trie_map); + alpha_map->alpha_to_trie_map = NULL; + } + if (alpha_map->trie_to_alpha_map) { + free (alpha_map->trie_to_alpha_map); + alpha_map->trie_to_alpha_map = NULL; + } + + range = alpha_map->first_range; + if (range) { + const AlphaChar alpha_begin = range->begin; + int n_cells, i; + AlphaChar a; + TrieChar trie_last = 0; + TrieChar tc; + + /* reconstruct alpha-to-trie map */ + alpha_map->alpha_begin = alpha_begin; + while (range->next) { + range = range->next; + } + alpha_map->alpha_end = range->end; + alpha_map->alpha_map_sz = n_cells = range->end - alpha_begin + 1; + alpha_map->alpha_to_trie_map + = (TrieIndex *) malloc (n_cells * sizeof (TrieIndex)); + if (UNLIKELY (!alpha_map->alpha_to_trie_map)) + goto error_alpha_map_not_created; + for (i = 0; i < n_cells; i++) { + alpha_map->alpha_to_trie_map[i] = TRIE_INDEX_MAX; + } + for (range = alpha_map->first_range; range; range = range->next) { + for (a = range->begin; a <= range->end; a++) { + alpha_map->alpha_to_trie_map[a - alpha_begin] = ++trie_last; + } + } + + /* reconstruct trie-to-alpha map */ + alpha_map->trie_map_sz = n_cells = trie_last + 1; + alpha_map->trie_to_alpha_map + = (AlphaChar *) malloc (n_cells * sizeof (AlphaChar)); + if (UNLIKELY (!alpha_map->trie_to_alpha_map)) + goto error_alpha_map_created; + alpha_map->trie_to_alpha_map[0] = 0; + tc = 1; + for (range = alpha_map->first_range; range; range = range->next) { + for (a = range->begin; a <= range->end; a++) { + alpha_map->trie_to_alpha_map[tc++] = a; + } + } + } + + return 0; + +error_alpha_map_created: + free (alpha_map->alpha_to_trie_map); + alpha_map->alpha_to_trie_map = NULL; +error_alpha_map_not_created: + return -1; +} + +/** + * @brief Add a range to alphabet map + * + * @param alpha_map : the alphabet map object + * @param begin : the first character of the range + * @param end : the last character of the range + * + * @return 0 on success, non-zero on failure + * + * Add a range of character codes from @a begin to @a end to the + * alphabet set. + */ +int +alpha_map_add_range (AlphaMap *alpha_map, AlphaChar begin, AlphaChar end) +{ + int res = alpha_map_add_range_only (alpha_map, begin, end); + if (res != 0) + return res; + return alpha_map_recalc_work_area (alpha_map); +} + TrieIndex alpha_map_char_to_trie (const AlphaMap *alpha_map, AlphaChar ac) { TrieIndex alpha_begin; - AlphaRange *range; if (UNLIKELY (0 == ac)) return 0; - alpha_begin = 1; - for (range = alpha_map->first_range; range; range = range->next) { - if (range->begin <= ac && ac <= range->end) - return alpha_begin + (ac - range->begin); + if (UNLIKELY (!alpha_map->alpha_to_trie_map)) + return TRIE_INDEX_MAX; - alpha_begin += range->end - range->begin + 1; + alpha_begin = alpha_map->alpha_begin; + if (alpha_begin <= ac && ac <= alpha_map->alpha_end) + { + return alpha_map->alpha_to_trie_map[ac - alpha_begin]; } return TRIE_INDEX_MAX; @@ -394,19 +508,8 @@ AlphaChar alpha_map_trie_to_char (const AlphaMap *alpha_map, TrieChar tc) { - TrieChar alpha_begin; - AlphaRange *range; - - if (UNLIKELY (0 == tc)) - return 0; - - alpha_begin = 1; - for (range = alpha_map->first_range; range; range = range->next) { - if (tc <= alpha_begin + (range->end - range->begin)) - return range->begin + (tc - alpha_begin); - - alpha_begin += range->end - range->begin + 1; - } + if (tc < alpha_map->trie_map_sz) + return alpha_map->trie_to_alpha_map[tc]; return ALPHA_CHAR_ERROR; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdatrie-0.2.9/datrie/tail.c new/libdatrie-0.2.10/datrie/tail.c --- old/libdatrie-0.2.9/datrie/tail.c 2015-03-02 10:00:04.000000000 +0100 +++ new/libdatrie-0.2.10/datrie/tail.c 2015-06-24 08:38:53.000000000 +0200 @@ -288,8 +288,11 @@ * so, dup it before it's overwritten */ TrieChar *tmp = NULL; - if (suffix) + if (suffix) { tmp = (TrieChar *) strdup ((const char *)suffix); + if (UNLIKELY (!tmp)) + return FALSE; + } if (t->tails[index].suffix) free (t->tails[index].suffix); t->tails[index].suffix = tmp; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdatrie-0.2.9/missing new/libdatrie-0.2.10/missing --- old/libdatrie-0.2.9/missing 2014-10-27 05:45:43.000000000 +0100 +++ new/libdatrie-0.2.10/missing 2015-08-15 12:37:35.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdatrie-0.2.9/test-driver new/libdatrie-0.2.10/test-driver --- old/libdatrie-0.2.9/test-driver 2014-10-27 05:45:43.000000000 +0100 +++ new/libdatrie-0.2.10/test-driver 2015-08-15 12:37:35.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2013-07-13.22; # UTC -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -106,11 +106,14 @@ # Test script is run here. "$@" >$log_file 2>&1 estatus=$? + if test $enable_hard_errors = no && test $estatus -eq 99; then - estatus=1 + tweaked_estatus=1 +else + tweaked_estatus=$estatus fi -case $estatus:$expect_failure in +case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; @@ -119,6 +122,12 @@ *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + # Report outcome to console. echo "${col}${res}${std}: $test_name"
