File reproducible-debuginfo.patch of Package rpm-ndb.26688

https://github.com/rpm-software-management/rpm/pull/485

From 5b29a1d4b1d25a16c24c2365980ac5fd847e1aa6 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Mon, 30 Jul 2018 19:02:46 +0200
Subject: [PATCH] find-debuginfo.sh: sort output of find

to make build results more reproducible
in spite of indeterministic filesystem readdir order.

For openSUSE, this helped to make squid, openssh, postfix and shadow
packages build reproducibly.

See https://reproducible-builds.org/ for why this is good.
---
 scripts/find-debuginfo.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh.orig
+++ scripts/find-debuginfo.sh
@@ -524,7 +524,7 @@ fi
 # Invoke the DWARF Compressor utility.
 if $run_dwz \
    && [ -d "${RPM_BUILD_ROOT}/usr/lib/debug" ]; then
-  readarray dwz_files < <(cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug)
+  readarray dwz_files < <(cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug | LC_ALL=C sort)
   if [ ${#dwz_files[@]} -gt 0 ]; then
     dwz_multifile_name="${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}-${RPM_PACKAGE_RELEASE}.${RPM_ARCH}"
     dwz_multifile_suffix=
openSUSE Build Service is sponsored by