From 8fc4e71f9b51438f09c8206ceb1b407bbaca8aab Mon Sep 17 00:00:00 2001 From: Florian Festi 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/brp-remove-la-files b/scripts/brp-remove-la-files index 58c513bf88..cffbd655c5 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 +# Check and remove symlinks first +find "$RPM_BUILD_ROOT" -type l -name '*.la' 2>/dev/null -print0 | + xargs -0 grep --fixed-strings '.la - a libtool library file' --files-with-matches --null | + xargs -0 rm --force + +# Process regular files 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