From 0be7ade6c25f249fba97219e97c357e8e01cd25bb99fe38d39eeb5c8aa18e0e3 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Mon, 25 Jul 2022 08:19:31 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/devel:tools/doxygen?expand=0&rev=169 --- doxygen-reproducible.patch | 70 ++++++++++++++++++++++++++++++++++++++ doxygen.spec | 3 ++ 2 files changed, 73 insertions(+) create mode 100644 doxygen-reproducible.patch diff --git a/doxygen-reproducible.patch b/doxygen-reproducible.patch new file mode 100644 index 0000000..1db8a22 --- /dev/null +++ b/doxygen-reproducible.patch @@ -0,0 +1,70 @@ +Index: doxygen-1.9.4/filesystem/filesystem.hpp +=================================================================== +--- doxygen-1.9.4.orig/filesystem/filesystem.hpp ++++ doxygen-1.9.4/filesystem/filesystem.hpp +@@ -5548,12 +5548,13 @@ public: + impl(const path& path, directory_options options) + : _base(path) + , _options(options) +- , _dir(nullptr) ++ , _n(-1) ++ , _name_list(nullptr) + , _entry(nullptr) + { + if (!path.empty()) { +- _dir = ::opendir(path.native().c_str()); +- if (!_dir) { ++ _n = ::scandir(path.native().c_str(), &_name_list, NULL, alphasort); ++ if (_n == -1) { + auto error = errno; + _base = filesystem::path(); + if ((error != EACCES && error != EPERM) || (options & directory_options::skip_permission_denied) == directory_options::none) { +@@ -5568,30 +5569,31 @@ public: + impl(const impl& other) = delete; + ~impl() + { +- if (_dir) { +- ::closedir(_dir); ++ if (_name_list) { ++ ::free(_name_list); + } + } + void increment(std::error_code& ec) + { +- if (_dir) { ++ if (_name_list) { + bool skip; + do { + skip = false; + errno = 0; +- _entry = ::readdir(_dir); +- if (_entry) { ++ if (_n >= 0) { ++ _entry = _name_list[_n--]; + _dir_entry._path = _base; + _dir_entry._path.append_name(_entry->d_name); + copyToDirEntry(); ++ ::free(_entry); + if (ec && (ec.value() == EACCES || ec.value() == EPERM) && (_options & directory_options::skip_permission_denied) == directory_options::skip_permission_denied) { + ec.clear(); + skip = true; + } + } + else { +- ::closedir(_dir); +- _dir = nullptr; ++ ::free(_name_list); ++ _name_list = nullptr; + _dir_entry._path.clear(); + if (errno) { + ec = detail::make_system_error(); +@@ -5634,7 +5636,8 @@ public: + } + path _base; + directory_options _options; +- DIR* _dir; ++ int _n; ++ struct ::dirent** _name_list; + struct ::dirent* _entry; + directory_entry _dir_entry; + std::error_code _ec; diff --git a/doxygen.spec b/doxygen.spec index 3f3729a..ab82b5f 100644 --- a/doxygen.spec +++ b/doxygen.spec @@ -36,6 +36,8 @@ Patch0: %{name}-modify_footer.patch Patch1: %{name}-no-lowercase-man-names.patch # PATCH-FIX-UPSTREAM Patch2: doxygen-gcc12.patch +# reproducible +Patch3: doxygen-reproducible.patch # The unified libclang-cpp library doesn't exist on older Leap / SLE Patch10: doxygen-no-libclang-cpp.patch BuildRequires: bison @@ -69,6 +71,7 @@ as well. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %if %{with libclang} %if 0%{?sle_version} == 150100 || (0%{?sle_version} == 150200 && !0%{?is_opensuse}) %patch10 -p1