From 0e56887b4c7d97b34e6f919c9b75ab83baf2a36b Mon Sep 17 00:00:00 2001 From: Vitaly Zaitsev Date: Sat, 9 May 2020 22:02:04 +0200 Subject: [PATCH] Updated to version 6.2.1. --- .gitignore | 1 + ...tes-layout-stripped-Google-Analytics.patch | 2 +- ...lates-layout-stripped-download-links.patch | 2 +- ...ld-do-not-create-virtual-environment.patch | 6 +- ...build-removed-all-pip-internet-stuff.patch | 6 +- doc-build-use-python3.patch | 2 +- doc-build-use-sphinx-build-3.patch | 4 +- doc-index-removed-GitHub-iframe.patch | 2 +- fix-ostream-support-in-sprintf.patch | 211 ------------------ fmt.spec | 8 +- sources | 2 +- 11 files changed, 19 insertions(+), 227 deletions(-) delete mode 100644 fix-ostream-support-in-sprintf.patch diff --git a/.gitignore b/.gitignore index a4c6759..2a3a944 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /5.3.0.tar.gz /6.1.2.tar.gz /6.2.0.tar.gz +/6.2.1.tar.gz diff --git a/doc-_templates-layout-stripped-Google-Analytics.patch b/doc-_templates-layout-stripped-Google-Analytics.patch index e68df8a..f724841 100644 --- a/doc-_templates-layout-stripped-Google-Analytics.patch +++ b/doc-_templates-layout-stripped-Google-Analytics.patch @@ -20,5 +20,5 @@ index d5f4b70d..8ff160de 100644 {%- macro searchform(classes, button) %} -- -2.25.1 +2.26.2 diff --git a/doc-_templates-layout-stripped-download-links.patch b/doc-_templates-layout-stripped-download-links.patch index 0c880e6..9d26197 100644 --- a/doc-_templates-layout-stripped-download-links.patch +++ b/doc-_templates-layout-stripped-download-links.patch @@ -45,5 +45,5 @@ index 8ff160de..85eba08d 100644 {% endif %} -- -2.25.1 +2.26.2 diff --git a/doc-build-do-not-create-virtual-environment.patch b/doc-build-do-not-create-virtual-environment.patch index e6105c4..1197217 100644 --- a/doc-build-do-not-create-virtual-environment.patch +++ b/doc-build-do-not-create-virtual-environment.patch @@ -1,10 +1,10 @@ diff --git a/doc/build.py b/doc/build.py -index 7df640bb..89af3fa7 100755 +index 73426713..af3313d1 100755 --- a/doc/build.py +++ b/doc/build.py @@ -7,16 +7,6 @@ from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE - versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0'] + versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0', '6.2.1'] -def create_build_env(dirname='virtualenv'): - # Create virtualenv. @@ -26,5 +26,5 @@ index 7df640bb..89af3fa7 100755 - create_build_env() build_docs(sys.argv[1]) -- -2.25.1 +2.26.2 diff --git a/doc-build-removed-all-pip-internet-stuff.patch b/doc-build-removed-all-pip-internet-stuff.patch index 7e416ac..77c0ce2 100644 --- a/doc-build-removed-all-pip-internet-stuff.patch +++ b/doc-build-removed-all-pip-internet-stuff.patch @@ -1,5 +1,5 @@ diff --git a/doc/build.py b/doc/build.py -index a7bfcf73..7df640bb 100755 +index e5bcbf3b..73426713 100755 --- a/doc/build.py +++ b/doc/build.py @@ -4,27 +4,9 @@ @@ -8,7 +8,7 @@ index a7bfcf73..7df640bb 100755 from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE -from distutils.version import LooseVersion - versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0'] + versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0', '6.2.1'] -def pip_install(package, commit=None, **kwargs): - "Install package using pip." @@ -62,5 +62,5 @@ index a7bfcf73..7df640bb 100755 def build_docs(version='dev', **kwargs): doc_dir = kwargs.get('doc_dir', os.path.dirname(os.path.realpath(__file__))) -- -2.25.1 +2.26.2 diff --git a/doc-build-use-python3.patch b/doc-build-use-python3.patch index 8c1f96b..88c71b5 100644 --- a/doc-build-use-python3.patch +++ b/doc-build-use-python3.patch @@ -18,5 +18,5 @@ index 2af32d53..0ad2d602 100644 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ -- -2.25.1 +2.26.2 diff --git a/doc-build-use-sphinx-build-3.patch b/doc-build-use-sphinx-build-3.patch index 200e481..b082a7a 100644 --- a/doc-build-use-sphinx-build-3.patch +++ b/doc-build-use-sphinx-build-3.patch @@ -16,7 +16,7 @@ index f3dae606..2af32d53 100644 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ diff --git a/doc/build.py b/doc/build.py -index 89af3fa7..88d26ec7 100755 +index af3313d1..44b31343 100755 --- a/doc/build.py +++ b/doc/build.py @@ -49,7 +49,8 @@ def build_docs(version='dev', **kwargs): @@ -30,5 +30,5 @@ index 89af3fa7..88d26ec7 100755 '-Dversion=' + version, '-Drelease=' + version, '-Aversion=' + version, '-Aversions=' + ','.join(main_versions), -- -2.25.1 +2.26.2 diff --git a/doc-index-removed-GitHub-iframe.patch b/doc-index-removed-GitHub-iframe.patch index 38c26b7..dc21d94 100644 --- a/doc-index-removed-GitHub-iframe.patch +++ b/doc-index-removed-GitHub-iframe.patch @@ -16,5 +16,5 @@ index d02ab0b0..a4d113d8 100644 - class="github-btn" width="100" height="20"> - -- -2.25.1 +2.26.2 diff --git a/fix-ostream-support-in-sprintf.patch b/fix-ostream-support-in-sprintf.patch deleted file mode 100644 index 5b52026..0000000 --- a/fix-ostream-support-in-sprintf.patch +++ /dev/null @@ -1,211 +0,0 @@ -From e99809f29da1002e8b9246e9278084ad231174e5 Mon Sep 17 00:00:00 2001 -From: Victor Zverovich -Date: Sun, 12 Apr 2020 07:38:54 -0700 -Subject: [PATCH] Fix ostream support in sprintf (#1631) - ---- - include/fmt/core.h | 12 +++++++----- - include/fmt/ostream.h | 33 ++++++++++++++++++++++++++++----- - include/fmt/printf.h | 9 +++++++-- - test/core-test.cc | 3 ++- - test/format-test.cc | 5 +++-- - test/printf-test.cc | 4 +--- - 6 files changed, 48 insertions(+), 18 deletions(-) - -diff --git a/include/fmt/core.h b/include/fmt/core.h -index cab3dfe0b..1a75100ad 100644 ---- a/include/fmt/core.h -+++ b/include/fmt/core.h -@@ -827,7 +827,8 @@ template struct string_value { - template struct custom_value { - using parse_context = basic_format_parse_context; - const void* value; -- void (*format)(const void* arg, parse_context& parse_ctx, Context& ctx); -+ void (*format)(const void* arg, -+ typename Context::parse_context_type& parse_ctx, Context& ctx); - }; - - // A formatting argument value. -@@ -887,9 +888,9 @@ template class value { - private: - // Formats an argument of a custom type, such as a user-defined class. - template -- static void format_custom_arg( -- const void* arg, basic_format_parse_context& parse_ctx, -- Context& ctx) { -+ static void format_custom_arg(const void* arg, -+ typename Context::parse_context_type& parse_ctx, -+ Context& ctx) { - Formatter f; - parse_ctx.advance_to(f.parse(parse_ctx)); - ctx.advance_to(f.format(*static_cast(arg), ctx)); -@@ -1066,7 +1067,7 @@ template class basic_format_arg { - public: - explicit handle(internal::custom_value custom) : custom_(custom) {} - -- void format(basic_format_parse_context& parse_ctx, -+ void format(typename Context::parse_context_type& parse_ctx, - Context& ctx) const { - custom_.format(custom_.value, parse_ctx, ctx); - } -@@ -1277,6 +1278,7 @@ template class basic_format_context { - public: - using iterator = OutputIt; - using format_arg = basic_format_arg; -+ using parse_context_type = basic_format_parse_context; - template using formatter_type = formatter; - - basic_format_context(const basic_format_context&) = delete; -diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h -index c4831533d..4526f5238 100644 ---- a/include/fmt/ostream.h -+++ b/include/fmt/ostream.h -@@ -9,9 +9,14 @@ - #define FMT_OSTREAM_H_ - - #include -+ - #include "format.h" - - FMT_BEGIN_NAMESPACE -+ -+template class basic_printf_parse_context; -+template class basic_printf_context; -+ - namespace internal { - - template class formatbuf : public std::basic_streambuf { -@@ -93,9 +98,9 @@ void format_value(buffer& buf, const T& value, - locale_ref loc = locale_ref()) { - formatbuf format_buf(buf); - std::basic_ostream output(&format_buf); -- #if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) -+#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) - if (loc) output.imbue(loc.get()); -- #endif -+#endif - output.exceptions(std::ios_base::failbit | std::ios_base::badbit); - output << value; - buf.resize(buf.size()); -@@ -104,14 +109,32 @@ void format_value(buffer& buf, const T& value, - // Formats an object of type T that has an overloaded ostream operator<<. - template - struct fallback_formatter::value>> -- : formatter, Char> { -- template -- auto format(const T& value, Context& ctx) -> decltype(ctx.out()) { -+ : private formatter, Char> { -+ auto parse(basic_format_parse_context& ctx) -> decltype(ctx.begin()) { -+ return formatter, Char>::parse(ctx); -+ } -+ template >::value)> -+ auto parse(ParseCtx& ctx) -> decltype(ctx.begin()) { -+ return ctx.begin(); -+ } -+ -+ template -+ auto format(const T& value, basic_format_context& ctx) -+ -> OutputIt { - basic_memory_buffer buffer; - format_value(buffer, value, ctx.locale()); - basic_string_view str(buffer.data(), buffer.size()); - return formatter, Char>::format(str, ctx); - } -+ template -+ auto format(const T& value, basic_printf_context& ctx) -+ -> OutputIt { -+ basic_memory_buffer buffer; -+ format_value(buffer, value, ctx.locale()); -+ return std::copy(buffer.begin(), buffer.end(), ctx.out()); -+ } - }; - } // namespace internal - -diff --git a/include/fmt/printf.h b/include/fmt/printf.h -index bfbaa0479..9c7b85ac5 100644 ---- a/include/fmt/printf.h -+++ b/include/fmt/printf.h -@@ -189,6 +189,10 @@ using internal::vprintf; - - template class printf_arg_formatter; - -+template -+class basic_printf_parse_context : public basic_format_parse_context { -+ using basic_format_parse_context::basic_format_parse_context; -+}; - template class basic_printf_context; - - /** -@@ -324,6 +328,7 @@ template class basic_printf_context { - using char_type = Char; - using iterator = OutputIt; - using format_arg = basic_format_arg; -+ using parse_context_type = basic_printf_parse_context; - template using formatter_type = printf_formatter; - - private: -@@ -331,7 +336,7 @@ template class basic_printf_context { - - OutputIt out_; - basic_format_args args_; -- basic_format_parse_context parse_ctx_; -+ parse_context_type parse_ctx_; - - static void parse_flags(format_specs& specs, const Char*& it, - const Char* end); -@@ -362,7 +367,7 @@ template class basic_printf_context { - - format_arg arg(int id) const { return args_.get(id); } - -- basic_format_parse_context& parse_context() { return parse_ctx_; } -+ parse_context_type& parse_context() { return parse_ctx_; } - - FMT_CONSTEXPR void on_error(const char* message) { - parse_ctx_.on_error(message); -diff --git a/test/core-test.cc b/test/core-test.cc -index f19d0423b..735fcde26 100644 ---- a/test/core-test.cc -+++ b/test/core-test.cc -@@ -210,7 +210,8 @@ TEST(ArgTest, FormatArgs) { - } - - struct custom_context { -- typedef char char_type; -+ using char_type = char; -+ using parse_context_type = fmt::format_parse_context; - - template struct formatter_type { - template -diff --git a/test/format-test.cc b/test/format-test.cc -index 6a873185c..e2bd98d27 100644 ---- a/test/format-test.cc -+++ b/test/format-test.cc -@@ -2260,8 +2260,9 @@ struct test_parse_context { - }; - - struct test_context { -- typedef char char_type; -- typedef fmt::basic_format_arg format_arg; -+ using char_type = char; -+ using format_arg = fmt::basic_format_arg; -+ using parse_context_type = fmt::format_parse_context; - - template struct formatter_type { - typedef fmt::formatter type; -diff --git a/test/printf-test.cc b/test/printf-test.cc -index 545e02aab..70b1238da 100644 ---- a/test/printf-test.cc -+++ b/test/printf-test.cc -@@ -508,9 +508,7 @@ TEST(PrintfTest, PrintfError) { - TEST(PrintfTest, WideString) { EXPECT_EQ(L"abc", fmt::sprintf(L"%s", L"abc")); } - - TEST(PrintfTest, PrintfCustom) { -- // The test is disabled for now because it requires decoupling -- // fallback_formatter::format from format_context. -- //EXPECT_EQ("abc", test_sprintf("%s", TestString("abc"))); -+ EXPECT_EQ("abc", test_sprintf("%s", TestString("abc"))); - } - - TEST(PrintfTest, OStream) { diff --git a/fmt.spec b/fmt.spec index 07333a2..f613cbd 100644 --- a/fmt.spec +++ b/fmt.spec @@ -1,7 +1,7 @@ %bcond_without doc Name: fmt -Version: 6.2.0 -Release: 2%{?dist} +Version: 6.2.1 +Release: 1%{?dist} Summary: Small, safe and fast formatting library for C++ License: BSD @@ -15,7 +15,6 @@ Patch5: doc-_templates-layout-stripped-download-links.patch Patch6: doc-index-removed-GitHub-iframe.patch Patch7: doc-build-use-sphinx-build-3.patch Patch8: doc-build-use-python3.patch -Patch9: fix-ostream-support-in-sprintf.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -119,6 +118,9 @@ popd %endif %changelog +* Sat May 09 2020 Vitaly Zaitsev - 6.2.1-1 +- Updated to version 6.2.1. + * Thu Apr 30 2020 Kefu Chai - 6.2.0-2 - Incorporate patch from upstream to address https://github.com/fmtlib/fmt/issues/1631 diff --git a/sources b/sources index d6d8d9c..59d74e6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (6.2.0.tar.gz) = 0003543f437bae416600a2b982eb133f65588bd36d7506fa7d883ae3133fcaf7ad825904af9b588ea22e5d91e56560aaf4243a6afa11ff6d8aace2e4bb1b0cee +SHA512 (6.2.1.tar.gz) = 520ef3addfecd9796253c347e0ecf4c18ef2f86d3b1b6b714f7834741f4737f1b7ed8365d3be46c9186617898911b23680cad2ae3cb7aadaf641ab32e327b0dc