Hello community, here is the log from the commit of package libfilezilla for openSUSE:Factory checked in at 2018-08-07 09:43:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libfilezilla (Old) and /work/SRC/openSUSE:Factory/.libfilezilla.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libfilezilla" Tue Aug 7 09:43:41 2018 rev:19 rq:627721 version:0.13.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libfilezilla/libfilezilla.changes 2018-06-20 15:34:20.087593434 +0200 +++ /work/SRC/openSUSE:Factory/.libfilezilla.new/libfilezilla.changes 2018-08-07 09:43:44.321378997 +0200 @@ -1,0 +2,12 @@ +Mon Aug 6 14:52:15 UTC 2018 - [email protected] + +- update to 0.13.0 + * New features: + - Add bool return value to replace_substrings to indicate + whether something has been replaced. + - fz::sprintf: Added %c format specifier + * Bugfixes and minor changes: + - MSW: Work around problematic DLL export of templates, + timers now work if libfilezilla has been built as DLL + +------------------------------------------------------------------- Old: ---- libfilezilla-0.12.3.tar.bz2 New: ---- libfilezilla-0.13.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libfilezilla.spec ++++++ --- /var/tmp/diff_new_pack.jmKGWu/_old 2018-08-07 09:43:44.737379721 +0200 +++ /var/tmp/diff_new_pack.jmKGWu/_new 2018-08-07 09:43:44.737379721 +0200 @@ -20,7 +20,7 @@ %define libname %{name}%{major} %define develname %{name}-devel Name: libfilezilla -Version: 0.12.3 +Version: 0.13.0 Release: 0 Summary: C++ library for filezilla License: GPL-2.0-or-later ++++++ libfilezilla-0.12.3.tar.bz2 -> libfilezilla-0.13.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/NEWS new/libfilezilla-0.13.0/NEWS --- old/libfilezilla-0.12.3/NEWS 2018-06-08 17:43:23.000000000 +0200 +++ new/libfilezilla-0.13.0/NEWS 2018-07-16 09:25:57.000000000 +0200 @@ -1,3 +1,9 @@ +0.13.0 (2018-07-16) + ++ Add bool return value to replace_substrings to indicate whether something has been replaced. ++ fz::sprintf: Added %c format specifier +- MSW: Work around problematic DLL export of templates, timers now work if libfilezilla has been built as DLL + 0.12.3 (2018-06-08) + Event handlers can now removed themselves while inside a callback diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/configure new/libfilezilla-0.13.0/configure --- old/libfilezilla-0.12.3/configure 2018-06-08 17:43:27.000000000 +0200 +++ new/libfilezilla-0.13.0/configure 2018-07-16 10:17:49.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libfilezilla 0.12.3. +# Generated by GNU Autoconf 2.69 for libfilezilla 0.13.0. # # Report bugs to <[email protected]>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libfilezilla' PACKAGE_TARNAME='libfilezilla' -PACKAGE_VERSION='0.12.3' -PACKAGE_STRING='libfilezilla 0.12.3' +PACKAGE_VERSION='0.13.0' +PACKAGE_STRING='libfilezilla 0.13.0' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='https://lib.filezilla-project.org/' @@ -1413,7 +1413,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 libfilezilla 0.12.3 to adapt to many kinds of systems. +\`configure' configures libfilezilla 0.13.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1484,7 +1484,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libfilezilla 0.12.3:";; + short | recursive ) echo "Configuration of libfilezilla 0.13.0:";; esac cat <<\_ACEOF @@ -1621,7 +1621,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libfilezilla configure 0.12.3 +libfilezilla configure 0.13.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2066,7 +2066,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libfilezilla $as_me 0.12.3, which was +It was created by libfilezilla $as_me 0.13.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2932,7 +2932,7 @@ # Define the identity of the package. PACKAGE='libfilezilla' - VERSION='0.12.3' + VERSION='0.13.0' cat >>confdefs.h <<_ACEOF @@ -17303,7 +17303,7 @@ int main () { -struct dirent dp; dp.d_type = 0; +struct dirent dp; dp.d_type = 0; (void)dp; ; return 0; } @@ -20908,7 +20908,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libfilezilla $as_me 0.12.3, which was +This file was extended by libfilezilla $as_me 0.13.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20975,7 +20975,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libfilezilla config.status 0.12.3 +libfilezilla config.status 0.13.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/libfilezilla-0.12.3/configure.ac new/libfilezilla-0.13.0/configure.ac --- old/libfilezilla-0.12.3/configure.ac 2018-06-08 17:43:23.000000000 +0200 +++ new/libfilezilla-0.13.0/configure.ac 2018-07-16 09:26:14.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([libfilezilla],[0.12.3],[[email protected]],[],[https://lib.filezilla-project.org/]) +AC_INIT([libfilezilla],[0.13.0],[[email protected]],[],[https://lib.filezilla-project.org/]) AC_CONFIG_HEADERS([lib/libfilezilla/private/config.hpp]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR(config) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/lib/event.cpp new/libfilezilla-0.13.0/lib/event.cpp --- old/libfilezilla-0.12.3/lib/event.cpp 2016-01-31 11:35:01.000000000 +0100 +++ new/libfilezilla-0.13.0/lib/event.cpp 2018-07-16 09:23:45.000000000 +0200 @@ -1,10 +1,28 @@ #include "libfilezilla/event.hpp" +#include <map> +#include <libfilezilla/mutex.hpp> + namespace fz { -/// \private -/// This instantiation must be a public symbol -template class simple_event<timer_event_type, timer_id>; +size_t get_unique_type_id(std::type_info const& id) +{ + std::string name = id.name(); + + static fz::mutex m; + + fz::scoped_lock l(m); + static std::map<std::string, size_t> eventTypes; + + auto it = eventTypes.find(name); + if (it == eventTypes.end()) { + eventTypes.insert(std::make_pair(name, eventTypes.size())); + return eventTypes.size() - 1; + } + else { + return it->second; + } } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/lib/iputils.cpp new/libfilezilla-0.13.0/lib/iputils.cpp --- old/libfilezilla-0.12.3/lib/iputils.cpp 2017-09-29 10:41:58.000000000 +0200 +++ new/libfilezilla-0.13.0/lib/iputils.cpp 2018-07-16 09:23:45.000000000 +0200 @@ -5,15 +5,18 @@ namespace fz { template<typename String, typename Char = typename String::value_type> -String do_get_ipv6_long_form(String short_address) +String do_get_ipv6_long_form(String const& short_address) { + size_t start = 0; + size_t end = short_address.size(); + if (!short_address.empty() && short_address[0] == '[') { if (short_address.back() != ']') { return String(); } - short_address = short_address.substr(1, short_address.size() - 2); + ++start; + --end; } - short_address = str_tolower_ascii(short_address); Char buf[40] = { '0', '0', '0', '0', ':', '0', '0', '0', '0', ':', @@ -27,22 +30,21 @@ Char* out = buf; - const size_t len = short_address.size(); - if (len > 39) { + if (end - start > 39) { return String(); } // First part, before possible :: - size_t i = 0; + size_t i; size_t grouplength = 0; Char const* s = short_address.c_str(); - for (i = 0; i < len + 1; ++i) { - Char const& c = s[i]; - if (c == ':' || !c) { + for (i = start; i <= end; ++i) { + Char const& c = tolower_ascii(s[i]); + if (i == end || c == ':' || !c) { if (!grouplength) { // Empty group length, not valid - if (!c || s[i + 1] != ':') { + if (i == end || !c || s[i + 1] != ':') { return String(); } ++i; @@ -51,10 +53,10 @@ out += 4 - grouplength; for (size_t j = grouplength; j > 0; --j) { - *out++ = s[i - j]; + *out++ = tolower_ascii(s[i - j]); } // End of string... - if (!c) { + if (i == end || !c) { if (!*out) { // ...on time return buf; @@ -85,8 +87,9 @@ return String(); } // Too long group - if (++grouplength > 4) + if (++grouplength > 4) { return String(); + } } // Second half after :: @@ -94,13 +97,13 @@ Char* end_first = out; out = &buf[38]; size_t stop = i; - for (i = len - 1; i > stop; --i) { + for (i = end - 1; i > stop; --i) { if (out < end_first) { // Too long return String(); } - Char const& c = s[i]; + Char const& c = tolower_ascii(s[i]); if (c == ':') { if (!grouplength) { // Empty group length, not valid @@ -258,11 +261,13 @@ return address_type::unknown; } - if (segment > 255) + if (segment > 255) { return address_type::unknown; - if (!dotcount && !segment) + } + if (!dotcount && !segment) { return address_type::unknown; - dotcount++; + } + ++dotcount; segment = 0; } else if (c < '0' || c > '9') { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/lib/libfilezilla/event.hpp new/libfilezilla-0.13.0/lib/libfilezilla/event.hpp --- old/libfilezilla-0.12.3/lib/libfilezilla/event.hpp 2017-09-29 10:41:58.000000000 +0200 +++ new/libfilezilla-0.13.0/lib/libfilezilla/event.hpp 2018-07-16 09:23:45.000000000 +0200 @@ -4,6 +4,7 @@ #include "libfilezilla.hpp" #include <tuple> +#include <typeinfo> /** \file * \brief Declares event_base and simple_event<> @@ -42,9 +43,12 @@ Best solution is to have your derived type return the address of a static data member of it, as done in \ref fz::simple_event "simple_event". */ - virtual void const* derived_type() const = 0; + virtual size_t derived_type() const = 0; }; +///\private +size_t FZ_PUBLIC_SYMBOL get_unique_type_id(std::type_info const& id); + /** \brief This is the recommended event class. @@ -54,6 +58,7 @@ \see event_handler for usage example. */ + template<typename UniqueType, typename...Values> class simple_event final : public event_base { @@ -72,14 +77,16 @@ simple_event(simple_event const& op) = default; simple_event& operator=(simple_event const& op) = default; - /// \brief Returns a unique pointer for the type such that can be used directly in derived_type. - static void const* type() { - static const char* f = nullptr; - return &f; + /// \brief Returns a unique id for the type such that can be used directly in derived_type. + inline static size_t type() { + // Exporting templates from DLLs is problematic to say the least. It breaks + // ODR, so we use this trick that goes over the type name. + static int const v = get_unique_type_id(typeid(UniqueType*)); + return v; } /// \brief Simply returns \ref type() - virtual void const* derived_type() const { + virtual size_t derived_type() const { return type(); } @@ -109,10 +116,6 @@ */ typedef simple_event<timer_event_type, timer_id> timer_event; -/// \private -/// This instantiation must be a public symbol -extern template class FZ_PUBLIC_SYMBOL simple_event<timer_event_type, timer_id>; - } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/lib/libfilezilla/format.hpp new/libfilezilla-0.13.0/lib/libfilezilla/format.hpp --- old/libfilezilla-0.12.3/lib/libfilezilla/format.hpp 2017-07-10 19:43:37.000000000 +0200 +++ new/libfilezilla-0.13.0/lib/libfilezilla/format.hpp 2018-07-16 09:23:45.000000000 +0200 @@ -179,6 +179,20 @@ return String(); } +template<typename String, typename Arg> +typename std::enable_if_t<std::is_integral<std::decay_t<Arg>>::value, String> char_to_string(Arg&& arg) +{ + return String({static_cast<typename String::value_type>(static_cast<unsigned char>(arg))}); +} + + +template<typename String, typename Arg> +typename std::enable_if_t<!std::is_integral<std::decay_t<Arg>>::value, String> char_to_string(Arg&&) +{ + assert(0); + return String(); +} + template<typename String, typename... Args> String extract_arg(char, size_t, typename String::value_type, size_t) @@ -227,6 +241,9 @@ ret = pointer_to_string<String>(std::forward<Arg>(arg)); pad_arg(ret, flags, width); } + else if (type == 'c') { + ret = char_to_string<String>(std::forward<Arg>(arg)); + } else { assert(0); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/lib/libfilezilla/string.hpp new/libfilezilla-0.13.0/lib/libfilezilla/string.hpp --- old/libfilezilla-0.12.3/lib/libfilezilla/string.hpp 2018-05-06 11:22:43.000000000 +0200 +++ new/libfilezilla-0.13.0/lib/libfilezilla/string.hpp 2018-07-16 09:23:45.000000000 +0200 @@ -260,8 +260,8 @@ std::wstring FZ_PUBLIC_SYMBOL replaced_substrings(std::wstring const& in, std::wstring const& find, std::wstring const& replacement); /// Modifies \c in, replacing all occurrences of \c find with \c replacement -void FZ_PUBLIC_SYMBOL replace_substrings(std::string& in, std::string const& find, std::string const& replacement); -void FZ_PUBLIC_SYMBOL replace_substrings(std::wstring& in, std::wstring const& find, std::wstring const& replacement); +bool FZ_PUBLIC_SYMBOL replace_substrings(std::string& in, std::string const& find, std::string const& replacement); +bool FZ_PUBLIC_SYMBOL replace_substrings(std::wstring& in, std::wstring const& find, std::wstring const& replacement); /// Tokenizes string. Returns all non-empty substrings template<typename String, typename Delim, typename Container = std::vector<String>> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/lib/libfilezilla/version.hpp new/libfilezilla-0.13.0/lib/libfilezilla/version.hpp --- old/libfilezilla-0.12.3/lib/libfilezilla/version.hpp 2018-06-08 17:43:30.000000000 +0200 +++ new/libfilezilla-0.13.0/lib/libfilezilla/version.hpp 2018-07-16 10:17:51.000000000 +0200 @@ -9,15 +9,15 @@ #include <tuple> /// \brief Version string of the libfilezilla headers -#define LIBFILEZILLA_VERSION "0.12.3" +#define LIBFILEZILLA_VERSION "0.13.0" #define LIBFILEZILLA_VERSION_MAJOR 0 -#define LIBFILEZILLA_VERSION_MINOR 12 -#define LIBFILEZILLA_VERSION_MICRO 3 +#define LIBFILEZILLA_VERSION_MINOR 13 +#define LIBFILEZILLA_VERSION_MICRO 0 #define LIBFILEZILLA_VERSION_NANO 0 /// \brief Suffix string, e.g. "rc1" -#define LIBFILEZILLA_VERSION_SUFFIX "0.12.3" +#define LIBFILEZILLA_VERSION_SUFFIX "0.13.0" namespace fz { /// \brief Get version string of libfilezilla diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/lib/string.cpp new/libfilezilla-0.13.0/lib/string.cpp --- old/libfilezilla-0.12.3/lib/string.cpp 2018-05-06 11:22:43.000000000 +0200 +++ new/libfilezilla-0.13.0/lib/string.cpp 2018-07-16 09:23:45.000000000 +0200 @@ -291,13 +291,16 @@ namespace { template<typename String> -inline void do_replace_substrings(String& in, String const& find, String const& replacement) +inline bool do_replace_substrings(String& in, String const& find, String const& replacement) { + bool ret = false; size_t pos = in.find(find); while (pos != std::string::npos) { in.replace(pos, find.size(), replacement); pos = in.find(find, pos + replacement.size()); + ret = true; } + return ret; } } @@ -315,14 +318,14 @@ return ret; } -void replace_substrings(std::string& in, std::string const& find, std::string const& replacement) +bool replace_substrings(std::string& in, std::string const& find, std::string const& replacement) { - do_replace_substrings(in, find, replacement); + return do_replace_substrings(in, find, replacement); } -void replace_substrings(std::wstring& in, std::wstring const& find, std::wstring const& replacement) +bool replace_substrings(std::wstring& in, std::wstring const& find, std::wstring const& replacement) { - do_replace_substrings(in, find, replacement); + return do_replace_substrings(in, find, replacement); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/m4/d-type.m4 new/libfilezilla-0.13.0/m4/d-type.m4 --- old/libfilezilla-0.12.3/m4/d-type.m4 2015-11-02 14:47:31.000000000 +0100 +++ new/libfilezilla-0.13.0/m4/d-type.m4 2018-07-16 09:23:45.000000000 +0200 @@ -18,7 +18,7 @@ #include <sys/types.h> #include <dirent.h> ]], - [[struct dirent dp; dp.d_type = 0;]])], + [[struct dirent dp; dp.d_type = 0; (void)dp;]])], [gl_cv_struct_dirent_d_type=yes], [gl_cv_struct_dirent_d_type=no]) ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.3/tests/format.cpp new/libfilezilla-0.13.0/tests/format.cpp --- old/libfilezilla-0.12.3/tests/format.cpp 2017-02-20 22:19:51.000000000 +0100 +++ new/libfilezilla-0.13.0/tests/format.cpp 2018-07-16 09:23:45.000000000 +0200 @@ -114,4 +114,7 @@ CPPUNIT_ASSERT_EQUAL(std::string(" -77"), fz::sprintf("%+7d", -77)); CPPUNIT_ASSERT_EQUAL(std::string("+77 "), fz::sprintf("%+-7d", 77)); CPPUNIT_ASSERT_EQUAL(std::string("-77 "), fz::sprintf("%+-7d", -77)); + + CPPUNIT_ASSERT_EQUAL(std::string("x"), fz::sprintf("%c", char('x'))); + CPPUNIT_ASSERT_EQUAL(std::string("x"), fz::sprintf("%c", int('x'))); }
