From 4936c42b4d8ed68af45fe220d24b2a69baaf9676 Mon Sep 17 00:00:00 2001
From: Florian Festi <ffesti@redhat.com>
Date: Tue, 17 Sep 2024 13:13:13 +0200
Subject: [PATCH] brp-remove-la-files: Remove symlinks, too

As we check for file contents delete symlink before looking at regular
files.

Resolves: #3304
---
 scripts/brp-remove-la-files | 12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/scripts/brp-remove-la-files b/scripts/brp-remove-la-files
index 58c513bf88..0e6e58f31a 100755
--- a/scripts/brp-remove-la-files
+++ b/scripts/brp-remove-la-files
@@ -5,6 +5,12 @@ if [ -z "$RPM_BUILD_ROOT" ] || [ "$RPM_BUILD_ROOT" = "/" ]; then
   exit 0
 fi
 
-find "$RPM_BUILD_ROOT" -type f -name '*.la' 2>/dev/null -print0 |
-  xargs -0 grep --fixed-strings '.la - a libtool library file' --files-with-matches --null |
-  xargs -0 rm --force
+# Check and remove symlinks first then regular files
+for FILETYPE in l f
+do
+
+  find "$RPM_BUILD_ROOT" -type $FILETYPE -name '*.la' 2>/dev/null -print0 |
+    xargs -0 grep --fixed-strings '.la - a libtool library file' --files-with-matches --null |
+    xargs -0 rm --force
+
+done
