From 1769f1e84e47113493f13b42f5bf6d4ebf0d708e Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 8 Mar 2018 22:11:16 -0700 Subject: [PATCH] Add patch to fix autogen with empty files (bug #1551147) --- cmake-automoc.patch | 14 ++++++++++++++ cmake.spec | 6 ++++++ 2 files changed, 20 insertions(+) create mode 100644 cmake-automoc.patch diff --git a/cmake-automoc.patch b/cmake-automoc.patch new file mode 100644 index 0000000..b94cb71 --- /dev/null +++ b/cmake-automoc.patch @@ -0,0 +1,14 @@ +diff -up cmake-3.10.2/Source/cmQtAutoGenerators.cxx.automoc cmake-3.10.2/Source/cmQtAutoGenerators.cxx +--- cmake-3.10.2/Source/cmQtAutoGenerators.cxx.automoc 2018-01-18 07:48:42.000000000 -0700 ++++ cmake-3.10.2/Source/cmQtAutoGenerators.cxx 2018-03-08 21:09:50.451726324 -0700 +@@ -80,8 +80,8 @@ static bool ReadFile(std::string& conten + std::size_t const length = cmSystemTools::FileLength(filename); + cmsys::ifstream ifs(filename.c_str(), (std::ios::in | std::ios::binary)); + if (ifs) { +- content.resize(length); +- ifs.read(&content.front(), content.size()); ++ content.reserve(length); ++ content.assign(std::istreambuf_iterator{ifs}, {}); + if (ifs) { + success = true; + } else { diff --git a/cmake.spec b/cmake.spec index ffcd91f..ed473c9 100644 --- a/cmake.spec +++ b/cmake.spec @@ -96,6 +96,9 @@ Patch102: https://gitlab.kitware.com/cmake/cmake/merge_requests/1785.patc # Add dl to CMAKE_DL_LIBS on MINGW # https://gitlab.kitware.com/cmake/cmake/issues/17600 Patch103: cmake-mingw-dl.patch +# Fix autogen crash with empty files +# https://bugzilla.redhat.com/show_bug.cgi?id=1551147 +Patch104: cmake-automoc.patch # Patch for renaming on EPEL %if 0%{?name_suffix:1} @@ -501,6 +504,9 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || : %changelog +* Thu Mar 8 2018 Orion Poplawski - 3.10.2-4 +- Add patch to fix autogen with empty files (bug #1551147) + * Thu Mar 08 2018 Rex Dieter - 3.10.2-3 - better Qt dependencies