Hello community, here is the log from the commit of package libgee for openSUSE:Factory checked in at 2017-03-22 23:14:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libgee (Old) and /work/SRC/openSUSE:Factory/.libgee.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libgee" Wed Mar 22 23:14:23 2017 rev:37 rq:481744 version:0.20.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libgee/libgee.changes 2016-10-18 10:31:42.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libgee.new/libgee.changes 2017-03-22 23:14:25.296574336 +0100 @@ -1,0 +2,13 @@ +Tue Mar 21 10:04:14 UTC 2017 - [email protected] + +- Update to version 0.20.0: + + No changes. + +------------------------------------------------------------------- +Thu Feb 23 11:30:55 UTC 2017 - [email protected] + +- Update to version 0.19.91: + + Fix to_array on enums and flags. + + Add additional query operations to Traversable. + +------------------------------------------------------------------- Old: ---- libgee-0.18.1.tar.xz New: ---- libgee-0.20.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libgee.spec ++++++ --- /var/tmp/diff_new_pack.z7z3eE/_old 2017-03-22 23:14:26.840355632 +0100 +++ /var/tmp/diff_new_pack.z7z3eE/_new 2017-03-22 23:14:26.840355632 +0100 @@ -1,7 +1,7 @@ # # spec file for package libgee # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2010 Luis Medinas, Portugal # # All modifications and additions to the file contributed by third parties @@ -18,13 +18,13 @@ Name: libgee -Version: 0.18.1 +Version: 0.20.0 Release: 0 Summary: GObject-based library providing commonly used data structures License: LGPL-2.1+ Group: Development/Libraries/GNOME Url: http://live.gnome.org/Libgee -Source0: http://download.gnome.org/sources/libgee/0.18/%{name}-%{version}.tar.xz +Source0: http://download.gnome.org/sources/libgee/0.20/%{name}-%{version}.tar.xz Source1: baselibs.conf BuildRequires: gobject-introspection-devel BuildRequires: vala >= 0.25.1 ++++++ libgee-0.18.1.tar.xz -> libgee-0.20.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/ChangeLog new/libgee-0.20.0/ChangeLog --- old/libgee-0.18.1/ChangeLog 2016-10-12 02:00:10.000000000 +0200 +++ new/libgee-0.20.0/ChangeLog 2017-03-21 08:12:25.000000000 +0100 @@ -1,3 +1,48 @@ +2017-02-22 Maciej Piechotka <[email protected]> + + Release 0.19.91 + + Change @since to reflect the correct version + +2017-01-17 Rodrigo Moya <[email protected]> + + Add some more query operations for Traversable<G> + * first_match (Predicate<G>) returns the first item that matches + * any_match (Predicate<G>) checks if any element matches + * all_match (Predicate<G>) checks if all elements match + * max/min returns max/min value + * order_by to perform ordering on any Traversable + + https://bugzilla.gnome.org/show_bug.cgi?id=776558 + +2016-12-14 Rico Tzschichholz <[email protected]> + + Drop obsolete VALA_0_16 conditionals + +2016-11-23 Colomban Wendling <[email protected]> + + Fix converting enumerations and flags to arrays + Enumerations and flags are classed types for Vala, not integers, so + they don't fall in the `typeof(G) == typeof(int)` kind of tests. This + leads to using the generic code in which Vala assumes pointer-sized + elements, which is often not true for enumerations and flags. + + Add special case for those to use the `int` converters for enumerations + and flags. + + This is most generally correct, but not always: the compiler will + likely chose a larger type for a specific enumeration if one of its + value is larger than `int`. It would be tempting to use the + enumeration's class minimum and maximum values to determine the + appropriate type, but unfortunately the API for this uses int itself, + so doesn't help. + + https://bugzilla.gnome.org/show_bug.cgi?id=774669 + +2016-10-12 Maciej Piechotka <[email protected]> + + Release 0.18.1 + 2016-10-11 Ole André Vadla Ravnås <[email protected]> Fix memory-leaks by avoiding field initializers for generic fields @@ -1583,3 +1628,14 @@ gee: Fix memory leak in HashMap.remove and HashSet.remove Fixes bug 584440. + +2009-04-30 Jürg Billeter <[email protected]> + + Update code using deprecated # modifier or operator + + Fix build with Vala 0.7 + Based on patch by Thijs Vermeir, fixes bug 579182. + + Generate ChangeLog from git log + Add gitlog-to-changelog script from gnulib and a dist-hook to + generate ChangeLog file when creating tarballs. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/Makefile.in new/libgee-0.20.0/Makefile.in --- old/libgee-0.18.1/Makefile.in 2016-10-12 01:58:56.000000000 +0200 +++ new/libgee-0.20.0/Makefile.in 2017-03-21 08:12:20.000000000 +0100 @@ -196,8 +196,8 @@ DIST_SUBDIRS = gee tests doc benchmark am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/gee-0.8.pc.in $(top_srcdir)/Makefile.decl AUTHORS \ - COPYING NEWS README compile config.guess config.sub install-sh \ - ltmain.sh missing + COPYING NEWS README compile config.guess config.sub depcomp \ + install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/NEWS new/libgee-0.20.0/NEWS --- old/libgee-0.18.1/NEWS 2016-10-12 01:52:39.000000000 +0200 +++ new/libgee-0.20.0/NEWS 2017-03-21 08:05:40.000000000 +0100 @@ -1,3 +1,12 @@ +libgee 0.20.0 +============= + * No changes since previous release + +libgee 0.19.91 +============== + * Fix to_array on enums and flags + * Add additional query operations to Traversable + libgee 0.18.1 ============= * Various build and runtime fixes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/configure new/libgee-0.20.0/configure --- old/libgee-0.18.1/configure 2016-10-12 01:58:55.000000000 +0200 +++ new/libgee-0.20.0/configure 2017-03-21 08:12:21.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libgee 0.18.1. +# Generated by GNU Autoconf 2.69 for libgee 0.20.0. # # Report bugs to <https://bugzilla.gnome.org/enter_bug.cgi?product=libgee>. # @@ -651,8 +651,8 @@ # Identity of this package. PACKAGE_NAME='libgee' PACKAGE_TARNAME='libgee' -PACKAGE_VERSION='0.18.1' -PACKAGE_STRING='libgee 0.18.1' +PACKAGE_VERSION='0.20.0' +PACKAGE_STRING='libgee 0.20.0' PACKAGE_BUGREPORT='https://bugzilla.gnome.org/enter_bug.cgi?product=libgee' PACKAGE_URL='' @@ -1417,7 +1417,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libgee 0.18.1 to adapt to many kinds of systems. +\`configure' configures libgee 0.20.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1487,7 +1487,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libgee 0.18.1:";; + short | recursive ) echo "Configuration of libgee 0.20.0:";; esac cat <<\_ACEOF @@ -1617,7 +1617,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libgee configure 0.18.1 +libgee configure 0.20.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1895,7 +1895,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libgee $as_me 0.18.1, which was +It was created by libgee $as_me 0.20.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2762,7 +2762,7 @@ # Define the identity of the package. PACKAGE='libgee' - VERSION='0.18.1' + VERSION='0.20.0' cat >>confdefs.h <<_ACEOF @@ -12136,7 +12136,7 @@ -LIBGEE_LT_VERSION="7:1:5" +LIBGEE_LT_VERSION="8:0:6" GLIB_REQUIRED=2.36 @@ -13391,7 +13391,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libgee $as_me 0.18.1, which was +This file was extended by libgee $as_me 0.20.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13457,7 +13457,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libgee config.status 0.18.1 +libgee config.status 0.20.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/configure.ac new/libgee-0.20.0/configure.ac --- old/libgee-0.18.1/configure.ac 2016-10-12 01:51:38.000000000 +0200 +++ new/libgee-0.20.0/configure.ac 2017-03-21 08:09:02.000000000 +0100 @@ -1,4 +1,4 @@ -AC_INIT([libgee], [0.18.1], [https://bugzilla.gnome.org/enter_bug.cgi?product=libgee], [libgee]) +AC_INIT([libgee], [0.20.0], [https://bugzilla.gnome.org/enter_bug.cgi?product=libgee], [libgee]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS(config.h) AC_CONFIG_MACRO_DIR([m4]) @@ -12,7 +12,7 @@ LT_PREREQ([2.2.6]) LT_INIT([disable-static]) -LIBGEE_LT_VERSION="7:1:5" +LIBGEE_LT_VERSION="8:0:6" AC_SUBST(LIBGEE_LT_VERSION) GLIB_REQUIRED=2.36 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/gee/arraylist.vala new/libgee-0.20.0/gee/arraylist.vala --- old/libgee-0.18.1/gee/arraylist.vala 2014-11-28 21:28:30.000000000 +0100 +++ new/libgee-0.20.0/gee/arraylist.vala 2017-02-23 08:04:44.000000000 +0100 @@ -525,6 +525,8 @@ return wrap_float<G> ((float?[])data); } else if (t == typeof (double)) { return wrap_double<G> ((double?[])data); + } else if (t.is_enum () || t.is_flags ()) { + return wrap_int<G> ((int[])data); } else { return (owned)data; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/gee/collection.vala new/libgee-0.20.0/gee/collection.vala --- old/libgee-0.18.1/gee/collection.vala 2014-09-23 10:50:19.000000000 +0200 +++ new/libgee-0.20.0/gee/collection.vala 2017-02-23 08:04:44.000000000 +0100 @@ -179,6 +179,8 @@ return (G[]) to_float_array ((Collection<float>) this); } else if (t == typeof (double)) { return (G[]) to_double_array ((Collection<double>) this); + } else if (t.is_enum () || t.is_flags ()) { + return (G[]) to_int_array ((Collection<int>) this); } else { G[] array = new G[size]; int index = 0; @@ -222,6 +224,8 @@ return add_all_float_array ((Collection<float>) this, (float? [])array); } else if (t == typeof (double)) { return add_all_double_array ((Collection<double>) this, (double? [])array); + } else if (t.is_enum () || t.is_flags ()) { + return add_all_int_array ((Collection<int>) this, (int [])array); } else { bool changed = false; foreach (unowned G item in array) { @@ -265,6 +269,8 @@ return contains_all_float_array ((Collection<float>) this, (float? [])array); } else if (t == typeof (double)) { return contains_all_double_array ((Collection<double>) this, (double? [])array); + } else if (t.is_enum () || t.is_flags ()) { + return contains_all_int_array ((Collection<int>) this, (int [])array); } else { foreach (unowned G item in array) { if (!contains (item)) { @@ -311,6 +317,8 @@ return remove_all_float_array ((Collection<float>) this, (float? [])array); } else if (t == typeof (double)) { return remove_all_double_array ((Collection<double>) this, (double? [])array); + } else if (t.is_enum () || t.is_flags ()) { + return remove_all_int_array ((Collection<int>) this, (int [])array); } else { bool changed = false; foreach (unowned G item in array) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/gee/priorityqueue.vala new/libgee-0.20.0/gee/priorityqueue.vala --- old/libgee-0.18.1/gee/priorityqueue.vala 2016-10-12 01:37:14.000000000 +0200 +++ new/libgee-0.20.0/gee/priorityqueue.vala 2017-02-23 08:04:44.000000000 +0100 @@ -350,11 +350,7 @@ _lm_head = null; _lm_tail = null; _p = null; -#if VALA_0_16 _a = new Type1Node<G>?[0]; -#else - _a = new Type1Node<G>[0]; -#endif _lp_head = null; _lp_tail = null; _b = new bool[0]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/gee/traversable.vala new/libgee-0.20.0/gee/traversable.vala --- old/libgee-0.18.1/gee/traversable.vala 2014-11-28 21:28:30.000000000 +0100 +++ new/libgee-0.20.0/gee/traversable.vala 2017-02-23 08:29:44.000000000 +0100 @@ -446,6 +446,118 @@ } } + /** + * Returns the first element that matches a given condition + * + * @param pred Predicate to be called to check for matches + * @return The first element that matches or null + * @since 0.19.91 + */ + [CCode (ordering = 10)] + public virtual G? first_match (owned Predicate<G> pred) { + G? result = null; + this.foreach ((item) => { + if (pred (item)) { + result = item; + return false; + } + return true; + }); + return (owned) result; + } + + /** + * Returns whether any element matches the given predicate. + * + * This is similar to @first_match, with the difference that it + * just returns whether there is a match or not, not the value + * of the match. + * + * @param pred Predicate to be called to check for matches + * @return Whether there was a match or not + * @since 0.19.91 + */ + [CCode (ordering = 11)] + public virtual bool any_match (owned Predicate<G> pred) { + return this.first_match (pred) != null; + } + + /** + * Checks whether all elements match the given predicate. + * + * @param pred Predicate to be called to check for matches + * @return Whether all elements match or not + * @since 0.19.91 + */ + [CCode (ordering = 12)] + public virtual bool all_match (owned Predicate<G> pred) { + bool result = true; + this.foreach ((item) => { + if (!pred (item)) { + result = false; + return false; + } + return true; + }); + return result; + } + + /** + * Returns the item in the sequence that contains the max value + * based on the given compare function. + * + * @param compare Function to be called for comparisons + * @return The item containing the max value. + * @since 0.19.91 + */ + [CCode (ordering = 13)] + public virtual G max (owned CompareDataFunc<G> compare) { + G max_value = null; + this.foreach ((item) => { + if (max_value == null || compare (max_value, item) > 0) { + max_value = item; + } + return true; + }); + return max_value; + } + + /** + * Returns the item in the sequence that contains the min value + * based on the given compare function. + * + * @param compare Function to be called for comparisons + * @return The item containing the min value. + * @since 0.19.91 + */ + [CCode (ordering = 14)] + public virtual G min (owned CompareDataFunc<G> compare) { + G min_value = null; + this.foreach ((item) => { + if (min_value == null || compare (min_value, item) < 0) { + min_value = item; + } + return true; + }); + return min_value; + } + + /** + * Returns a new iterator containing the elements in the source + * ordered as specified by the comparison function. + * + * @param compare Comparison function + * @return A new iterator with the source elements sorted. + * @since 0.19.91 + */ + [CCode (ordering = 15)] + public virtual Iterator<G> order_by (owned CompareDataFunc<G>? compare = null) { + ArrayList<G> result = new ArrayList<G> (); + this.foreach ((item) => result.add (item)); + result.sort (compare); + return result.iterator (); + } + public enum Stream { YIELD, CONTINUE, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/tests/testarraylist.vala new/libgee-0.20.0/tests/testarraylist.vala --- old/libgee-0.18.1/tests/testarraylist.vala 2016-10-12 01:20:45.000000000 +0200 +++ new/libgee-0.20.0/tests/testarraylist.vala 2017-02-23 08:04:44.000000000 +0100 @@ -100,6 +100,10 @@ } } + private enum TestEnum { + ONE, TWO, THREE + } + private void test_typed_to_array () { // Test with a bool collection Gee.List<bool> bool_list = new ArrayList<bool> (); @@ -131,14 +135,22 @@ assert (double_list.add (1.5d)); assert (double_list.add (2.0d)); -#if VALA_0_16 double?[] double_array = double_list.to_array (); -#else - double[] double_array = double_list.to_array (); -#endif index = 0; foreach (double element in double_list) { assert (element == double_array[index++]); } + + // Test with an enum collection + Gee.List<TestEnum> enum_list = new ArrayList<TestEnum> (); + assert (enum_list.add (TestEnum.ONE)); + assert (enum_list.add (TestEnum.TWO)); + assert (enum_list.add (TestEnum.THREE)); + + TestEnum[] enum_array = enum_list.to_array (); + index = 0; + foreach (TestEnum element in enum_list) { + assert (element == enum_array[index++]); + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgee-0.18.1/tests/testcollection.vala new/libgee-0.20.0/tests/testcollection.vala --- old/libgee-0.18.1/tests/testcollection.vala 2014-09-23 10:50:19.000000000 +0200 +++ new/libgee-0.20.0/tests/testcollection.vala 2017-02-23 08:04:44.000000000 +0100 @@ -51,6 +51,11 @@ add_test ("[Collection] scan", test_scan); add_test ("[Collection] filter", test_filter); add_test ("[Collection] chop", test_chop); + add_test ("[Collection] first_match", test_first_match); + add_test ("[Collection] any_match", test_any_match); + add_test ("[Collection] all_match", test_all_match); + add_test ("[Collection] max_min", test_max_min); + add_test ("[Collection] order_by", test_order_by); } protected Collection<string> test_collection; @@ -1197,5 +1202,62 @@ assert (!iter.next ()); assert (iter2.next ()); } + + public void test_first_match () { + assert (test_collection.add ("one")); + assert (test_collection.add ("two")); + assert (test_collection.add ("three")); + + assert (test_collection.first_match ((x) => x == "one") == "one"); + assert (test_collection.first_match ((x) => x == "two") == "two"); + assert (test_collection.first_match ((x) => x == "three") == "three"); + assert (test_collection.first_match ((x) => x == "four") == null); + } + + public void test_any_match () { + assert (test_collection.add ("one")); + assert (test_collection.add ("two")); + assert (test_collection.add ("three")); + + assert (test_collection.any_match ((x) => x == "one")); + assert (test_collection.any_match ((x) => x == "two")); + assert (test_collection.any_match ((x) => x == "three")); + assert (!test_collection.any_match ((x) => x == "four")); + } + + public void test_all_match () { + assert (test_collection.add ("one")); + assert (test_collection.all_match ((x) => x == "one")); + + assert (test_collection.add ("two")); + assert (!test_collection.all_match ((x) => x == "one")); + } + + public void test_max_min () { + assert (test_collection.add ("one")); + assert (test_collection.add ("two")); + assert (test_collection.add ("three")); + + assert (test_collection.max ((a, b) => strcmp (a, b)) == "one"); + assert (test_collection.min ((a, b) => strcmp (a, b)) == "two"); + } + + public void test_order_by () { + assert (test_collection.add ("one")); + assert (test_collection.add ("two")); + assert (test_collection.add ("three")); + + var sorted_collection = test_collection.order_by ((a, b) => strcmp (a, b)); + + string previous_item = null; + while (sorted_collection.next ()) { + var item = sorted_collection.get (); + if (previous_item != null) { + assert (strcmp (previous_item, item) <= 0); + } + + previous_item = item; + } + } }
